 He was the only son of George Foster, calico printer and justice of the peace in Lancashire and the West Riding of Yorkshire.After education at private schools Foster became a student of chemistry at University College, London.He graduated with honours and a prize in 1855 and then served at the college as an assistant in Professor Williamson's chemistry laboratory.