Born in Dedham, Massachusetts, Williams attended private schools, graduated from the Dedham High School in 1868, and from Dartmouth College in 1872.
He taught school in West Brewster, Massachusetts in 1872 and 1873.