William Hamilton Grape was born around 1836 in Baltimore, Maryland, to George and Charlotte Grape. His father died in the 1840s. He grew up in Baltimore, and by 1860, he was working as a carpenter.
He remained loyal to the Union during the Civil War. He enlisted in the Union army on August 26, 1861, and he mustered in as a private in Purnell’s Legion of Maryland Infantry. According to his service records, he was 5 feet, 7¼ inches tall, with dark hair and grey eyes. He was promoted to corporal in late 1861. Confederate forces captured him at Catlett’s Station on August 22, 1862. He was exchanged on November 19, and he rejoined the regiment. He was promoted to sergeant in early 1863.
In February 1863, he wrote that he was "proud that I ever did enlist to serve my country...I shall allways look back with pleasure to the time I was in the army to the three years I gave to my country to crush the Rebelion and help to build this Union up stronger than ever." He added that he "hope[d] the day is not far off when this war will be over when peace will dawn on this once happy land and the North and the South will be united and the negro question be forever settled." Union officials transferred him to Company K of the 1st Maryland Infantry in February 1864. The regiment took part in the siege of Petersburg. Confederate forces captured him again on August 21, 1864, and he remained a prisoner of war until the end of the war.
He returned to Baltimore after the war and resumed his work as a carpenter. He married Anna Baden on January 28, 1868. They had at least two children: Frederick, born around 1869; and John, born around 1873. By 1870, he owned $1,500 of real estate and $300 of personal property. A decade later, he was working as an agent for a coal company. He died sometime after 1910.