Born in Leith, Thomas Anderson graduated from the University of Edinburgh with a medical doctorate in 1841. Having developed an interest in chemistry during his medical studies, he then spent several years studying chemistry in Europe, including spells under Jöns Jakob Berzelius in Sweden and Justus von Liebig in Germany. Returning to Edinburgh, he worked at the University of Edinburgh and at the Highland and Agricultural Society of Scotland. In 1852, he was appointed Regius Professor of Chemistry at the University of Glasgow and remained in that post for the remainder of his career. In 1854, he became one of the editors of the Edinburgh New Philosophical Journal. In 1872, Anderson was awarded a Royal Medal from the Royal Society "for his investigations on the organic bases of Dippells animal oil; on codeine; on the crystallized constituents of opium; on piperin and on papaverin; and for his researches in physiological and animal chemistry."
His later years were marred by a progressive neurological disease which may have been syphilis. He resigned his chair in early 1874, and died later that year in Chiswick.
He was succeeded by John Ferguson.