William J. Stewart was born in Pennsylvania. By the early 1860s, he was probably living in Sidney, Ohio. He got married, and he probably had a son named Charles. In May 1861, he received a commission as a 1st lieutenant in the 16th United States Infantry. He was promoted to captain in May 1863. Confederate forces captured him during the Battle of Chickamauga in September 1863, and he spent the next several months imprisoned in Macon, Georgia; Columbia, South Carolina; and Richmond, Virginia. He may have been exchanged in the spring of 1864, and he was cashiered from military service on February 16, 1865.