Thayer was born in Mendon, Massachusetts on June 11, 1819. He attended the local public school, then Bellingham High School. He attended the Academy of Amherst and in 1840 graduated from Worcester Academy. In 1845 he graduated from Brown University as salutatorian. Thayer returned to his college prepatory school, Worcester Academy, to teach. 