He was educated at Glasgow Academy and the University of Glasgow, where he graduated first in classics, logic and philosophy. In his twentieth year he became totally blind, but he held to his resolve to enter the ministry, and gave himself to theological and historical study. In 1879 the University of Edinburgh conferred upon him the honorary degree of D.D.. In 1890, he became a fellow of the Royal Society of Edinburgh, upon the proposal of Sir William Thomson, Robert Flint, Hugh Macmillan and James Lindsay.