He was a Fellow of the Royal Society, president of the Epidemiological Society of London (1881–1883), and Chief Medical Officer of the United Kingdom (1879–1892). He received his medical degrees from the University College London and the University of London, graduating in 1854. Between 1855 and 1860 he worked as an assistant physician at the Great Ormond Street Hospital for sick children.
Between 1861 and 1968 he worked as physician at the London Fever Hospital. In 1866 Buchanan was elected a fellow of the Royal College of Physicians of London, where he served as censor (1892–1894) and Lettsomian lecturer (1867). He was president of the Epidemiological Society (1881–1883), and in 1882 he was elected a fellow of the Royal Society.
Buchanan was mostly noted for his public health service. In 1856 he was made first medical officer to St Giles, which held the highest death rate among London districts. Based on his observations there he wrote several highly praised reports on the causes and prevention of infectious deceases, eventually becoming a national authority in the field.
In particular, his work on vaccination against smallpox led to the Vaccination Act of 1867, and his notes on the causes of typhus during the Lancashire Cotton Famine of 1862 helped fight the decease in Liverpool and Warrington in the late 1860s and eventually eradicate it nationwide after 1870s. Buchanan reasonably attributed the spread of typhus to overcrowding and squalor in big cities. He later noted that reducing soil dampness through drainage works reduced mortality from respiratory tuberculosis.
In 1869 Buchanan was appointed as a permanent inspector at the medical department of the Privy Council, and in 1879 as the Chief Medical Officer of the United Kingdom. He resigned from that post in April 1892, when he was knighted, and became Chairman of the Royal Commission on Tuberculosis. He helped secure the admission of women to the University College and University of London.
Buchanan also played an active part in the affairs of the Worshipful Society of Apothecaries, first as a member and then an assistant. In 1893 he was made an honorary LL.D. of the University of Edinburgh. Buchanan was married twice, first to Mary Murphy and then in 1865 to Alice Mary Asmar.
Buchanan died of heart failure while recovering from heart surgery in 1895 and was buried at Brookfield Cemetery. In 1897 the Royal Society started awarding a gold medal every five years (now reduced to two years) for services to sanitary science. The medal was named the Buchanan Medal in his honour and featured his bust on the obverse.
Buchanan's works have not been collected and are scattered through various official reports.
In 1858 he also became a member of the Royal College of Physicians of London, and opened his own practice at Gower Street. Buchanan remained connected with the University College London throughout his whole life, being elected a fellow in 1864, and serving as a member of the council.