[2] He was born in Edinburgh the only child of David Swan, engineer, and his wife, Janet Smith.
[7] In 1856, Swan applied to join the faculty at Marischal College, but was passed over in favor of James Clerk Maxwell.
[8] Swan subsequently joined the Scottish Naval and Military Academy, where in 1857 he demonstrated that Fraunhofer's D-line in the spectrum of the Sun was caused by the presence of sodium;[9] in this respect, he is sometimes credited as having inspired Gustav Kirchhoff's research into the same issue.
He died of heart disease at his wife's country house of Ardchapel in Shandon in western Scotland.
In 1843, the Royal Scottish Society of the Arts awarded Swan a gold medal for his scientific achievements.