William H. Swartz was born on April 20, 1844, in Point Pleasant, Pennsylvania, to Andrew and Catherine Swartz. His father was a coach maker who owned $1,500 of real estate and $250 of personal property by 1860. Swartz grew up and attended school in Plumstead, Pennsylvania.
He enlisted in the Union army on August 15, 1862, and he mustered in as a private in Company F of the 128th Pennsylvania Infantry. The regiment took part in the Battle of Antietam and the Battle of Chancellorsville, and he mustered out on May 19, 1863. He returned to the Union army soon afterward, mustering in as a private in Company D of the 31st Pennsylvania Militia Infantry on July 17, 1863. He mustered out on August 8, 1863. He enlisted in the Union army again on July 13, 1864, and he mustered in as a sergeant in Company E of the 196th Pennsylvania Infantry. He mustered out for the final time on November 17, 1864.
He settled in Bethlehem, Pennsylvania, after the war, and he married Martha Burkett around 1880. They had at least two children: Mary, born around 1883; and George, born around 1892. He earned a living as a carpenter. He applied for a federal pension in December 1894 and eventually secured one. By 1910, he was living in his daughter Mary’s household in Bethlehem. He died of chronic nephritis in Bethlehem on April 18, 1926.