Williamson was born in 1824 in Wandsworth, London, the second of three children of Alexander Williamson (originally from Elgin) a clerk with the East India Company and his wife, Antonia McAndrew, daughter of a prominent London merchant. Despite early physical infirmity, the loss of sight in one eye and a largely useless left arm, Williamson grew up in a caring and stimulating intellectual environment. After an early childhood spent in Brighton and then schools in Kensington, Williams enrolled at the University of Heidelberg in 1841. After working under Leopold Gmelin at Heidelberg, he transferred to the University of Giessen to work with Justus von Liebig, where he received his Ph.D. in 1845. Williamson then spent three years in Paris studying higher mathematics under Auguste Comte.