Masson was educated at Oliphant's School in Edinburgh (1865–68), the Edinburgh Academy and then the University of Edinburgh, where he graduated MA in 1877. He studied chemistry under Alexander Crum Brown (BSc 1880). He then studied under Friedrich Wöhler at Göttingen in 1879 before obtaining a position with William Ramsay at Bristol, with whom he did research work on phosphorus. Masson returned to the University of Edinburgh in 1881 with a Research Scholarship for three years, obtaining his D.Sc. degree in 1884. Masson was involved in the founding of the Student Representative Council. His research during this period included investigations in the preparation and properties of nitroglycerin (glyceryl trinitrate).