After receiving his early education at Edinburgh Academy, he entered as a medical student at the university in that city, and subsequently studied chemistry and mineralogy at Klausthal and Freiburg.
After receiving his early education at Edinburgh Academy 1837 to 1843 he moved to Merchiston Castle School. In 1845 he entered as a medical student at the university in that city, and subsequently studied chemistry and mineralogy at Klausthal and Freiburg.