He died of angina pectoris on 20 July 1912 at the Tor-na-Coille Hotel in Banchory, Banchory, survived by his wife. He was buried in the cathedral precincts at St Andrews, where a monument can be visited in the south-east corner of the 19th century section.
The earliest of his publications is Custom and Myth (1884). In Myth, Ritual and Religion (1887) he explained the "irrational" elements of mythology as survivals from more primitive forms. Lang's Making of Religion was heavily influenced by the 18th century idea of the "noble savage": in it, he maintained the existence of high spiritual ideas among so-called "savage" races, drawing parallels with the contemporary interest in occult phenomena in England. His Blue Fairy Book (1889) was a beautifully produced and illustrated edition of fairy tales that has become a classic. This was followed by many other collections of fairy tales, collectively known as Andrew Lang's Fairy Books. In the preface of the Lilac Fairy Book he credits his wife with translating and transcribing most of the stories in the collections. Lang examined the origins of totemism in Social Origins (1903).
Lang extensively cited nineteenth- and twentieth-century European spiritualism to challenge the idea of his teacher, Tylor, that belief in spirits and animism were inherently irrational. Lang used Tylor's work and his own psychical research in an effort to posit an anthropological critique of materialism. Andrew Lang fiercely debated with his Folklore Society colleague Edward Clodd over 'Psycho-folklore' a strand of the discipline which aimed to connect folklore with psychical research. 
He collaborated with S. H. Butcher in a prose translation (1879) of Homer's Odyssey, and with E. Myers and Walter Leaf in a prose version (1883) of the Iliad, both still noted for their archaic but attractive style. He was a Homeric scholar of conservative views. Other works include Homer and the Study of Greek found in Essays in Little (1891), Homer and the Epic (1893); a prose translation of The Homeric Hymns (1899), with literary and mythological essays in which he draws parallels between Greek myths and other mythologies; Homer and his Age (1906); and "Homer and Anthropology" (1908).
Andrew Lang at work
Lang's writings on Scottish history are characterised by a scholarly care for detail, a piquant literary style, and a gift for disentangling complicated questions. The Mystery of Mary Stuart (1901) was a consideration of the fresh light thrown on Mary, Queen of Scots, by the Lennox manuscripts in the University Library, Cambridge, approving of her and criticising her accusers.
He also wrote monographs on The Portraits and Jewels of Mary Stuart (1906) and James VI and the Gowrie Mystery (1902). The somewhat unfavourable view of John Knox presented in his book John Knox and the Reformation (1905) aroused considerable controversy. He gave new information about the continental career of the Young Pretender in Pickle the Spy (1897), an account of Alestair Ruadh MacDonnell, whom he identified with Pickle, a notorious Hanoverian spy. This was followed by The Companions of Pickle (1898) and a monograph on Prince Charles Edward (1900). In 1900 he began a History of Scotland from the Roman Occupation (1900). The Valet's Tragedy (1903), which takes its title from an essay on Dumas's Man in the Iron Mask, collects twelve papers on historical mysteries, and A Monk of Fife (1896) is a fictitious narrative purporting to be written by a young Scot in France in 1429-1431.
Lang's earliest publication was a volume of metrical experiments, The Ballads and Lyrics of Old France (1872), and this was followed at intervals by other volumes of dainty verse, Ballades in Blue China (1880, enlarged edition, 1888), Ballads and Verses Vain (1884), selected by Mr Austin Dobson; Rhymes à la Mode (1884), Grass of Parnassus (1888), Ban and Arrière Ban (1894), New Collected Rhymes (1905).
Lang was active as a journalist in various ways, ranging from sparkling "leaders" for the Daily News to miscellaneous articles for the Morning Post, and for many years he was literary editor of Longman's Magazine; no critic was in more request, whether for occasional articles and introductions to new editions or as editor of dainty reprints.
He edited The Poems and Songs of Robert Burns (1896), and was responsible for the Life and Letters (1897) of JG Lockhart, and The Life, Letters and Diaries (1890) of Sir Stafford Northcote, 1st Earl of Iddesleigh. Lang discussed literary subjects with the same humour and acidity that marked his criticism of fellow folklorists, in Books and Bookmen (1886), Letters to Dead Authors (1886), Letters on Literature (1889), etc.
St Leonards Magazine. 1863. This was a reprint of several articles that appeared in the St Leonards Magazine that Lang edited at St Andrews University. Includes the following Lang contributions: Pages 10-13, Dawgley Manor; A sentimental burlesque; Pages 25-26, Nugae Catulus; Pages 27-30, Popular Philosophies; pages 43-50 are 'Papers by Eminent Contributors', seven short parodies of which six are by Lang.
Aristotle's Politics Books I. III. IV. (VII.). The Text of Bekker. With an English translation by W. E. Bolland. Together with short introductory essays by A. Lang To page 106 are Lang's Essays, pp. 107-305 are the translation. Lang's essays without the translated text were later published as The Politics of Aristotle. Introductory Essays. 1886.
The Folklore of France (1878)
Specimens of a Translation of Theocritus. 1879. This was an advance issue of extracts from Theocritus, Bion and Moschus rendered into English prose
XXXII Ballades in Blue China (1880)
Oxford. Brief historical & descriptive notes (1880). The 1915 edition of this work was illustrated by painter George Francis Carline.
'Theocritus Bion and Moschus. Rendered into English Prose with an Introductory Essay. 1880.
Notes by Mr A. Lang on a collection of pictures by Mr J. E. Millais R.A. exhibited at the Fine Arts Society Rooms. 148 New Bond Street. 1881.
Household tales; their origin, diffusion, and relations to the higher myths. . Separate pre-publication issue of the "introduction" to Bohn's edition of Grimm's Household tales.
That Very Mab (1885) with May Kendall
Books and Bookmen (1886)
Letters to Dead Authors (1886)
In the Wrong Paradise (1886) stories
The Mark of Cain (1886) novel
Lines on the inaugural meeting of the Shelley Society. Reprinted for private distribution from the Saturday Review of 13 March 1886 and edited by Thomas Wise (1886)
La Mythologie Traduit de L'Anglais par Léon Léon Parmentier. Avec une préface par Charles Michel et des Additions de l'auteur. (1886) Never published as a complete book in English, although there was a Polish translation. The first 170 pages is a translation of the article in the 'Encyclopædia Britannica'. The rest is a combination of articles and material from 'Custom and Myth'.
Highways and Byways in The Border (1913) with John Lang
The Strange Story Book (1913) with Mrs. Lang
The Poetical Works (1923) edited by Mrs. Lang, four volumes
Old Friends Among the Fairies: Puss in Boots and Other Stories. Chosen from the Fairy Books (1926)
Tartan Tales From Andrew Lang (1928) edited by Bertha L. Gunterman
From Omar Khayyam (1935)
Andrew Lang's Fairy Books
Lang selected and edited 25 collections of stories that were published annually, beginning with The Blue Fairy Book in 1889 and ending with The Strange Story Book in 1913. They are sometimes called Andrew Lang's Fairy Books although the Blue Fairy Book and other Coloured Fairy Books are only 12 in the series. In this chronological list the Coloured Fairy Books alone are numbered.
^Grattan-Guinness, Ivor. (1982). Psychical Research: A Guide to Its History, Principles and Practices: In Celebration of 100 Years of the Society for Psychical Research. Aquarian Press. p. 123. ISBN0-85030-316-8
^Bihet, Francesca (2019) Late-Victorian Folklore Studies and Fairy-Lore. In: Betwixt and Between, 18-19 May 2019, Museum of Witchcraft and Magic, Boscastle. http://eprints.chi.ac.uk/4685/
^Andrew Lang, "Homer and Anthropology," in Homer and the Classics: Six Lectures Delivered before the University of Oxford by Arthur J. Evans, Andrew Lang, Gilbert Murray, F.B. Jevons, J.L. Myres, and W. Warde Fowler, ed. R.R. Marett, 44-65 (Oxford: The Clarendon Press, 1908).
^Waters, Grant M.. Dictionary of British Artists, Working 1900-1950, (Eastbourne Fine Art, Eastbourne, 1975), p. 59
de Cocq, Antonius P. L. (1968) Andrew Lang: A nineteenth century anthropologist (Diss. Rijksuniversiteit Utrecht, The Netherlands). Tilburg: Zwijsen.
Green, Roger Lancelyn. (1946) Andrew Lang: A critical biography with a short-title bibliography. Leicester: Ward.
Lang, Andrew. 2015. The Edinburgh Critical Edition of the Selected Writings of Andrew Lang, Volume I. Edited by Andrew Teverson, Alexandra Warwick, and Leigh Wilson. Edinburgh: Edinburgh University Press. 456 pages. ISBN9781474400213 (hard cover).
Lang, Andrew. 2015. The Edinburgh Critical Edition of the Selected Writings of Andrew Lang, Volume II. Edited by Andrew Teverson, Alexandra Warwick, and Leigh Wilson. Edinburgh: Edinburgh University Press. 416 pages. ISBN9781474400237 (hard cover).