Born in 1822 in Plymouth, Massachusetts, Williams was living in Portsmouth, Maine, when he joined the Navy. He served as a sailmaker's mate on the in the Wilmington Campaign, from the First Battle of Fort Fisher on December 24, 1864, through the campaign's end on February 22, 1865. For his actions during this period, he was awarded the Medal of Honor months later, on June 22, 1865.