Muir was born in Glasgow, Scotland, one of four brothers amongst whom was William Muir, and educated at the grammar school of Irvine, the University of Glasgow, and the East India Company College at Haileybury. He arrived in India in 1829 as a civil servant in Bengal, and served in various offices, as assistant secretary to the board of revenue, Allahabad, as collector at Azamgarh and as civil and session judge at Fatehpur. In 1844, he was appointed to be the first principal of Victoria College, Benaras, that later evolved into the Sampurnanand Sanskrit University. He left the Indian Civil Service in 1853 and returned to Edinburgh. In 1862 he endowed the chair of Sanskrit in the University of Edinburgh, and was the main agent in founding the Shaw fellowship in moral philosophy. He was a D.C.L. of Oxford, LL.D. of Edinburgh and PhD of Bonn, and was one of the first to receive the distinction of Companion of the Indian Empire.
Muir died unmarried, on 7 March 1882, at 10 Merchiston Avenue, Edinburgh.
He is buried in the Grange Cemetery against the western wall of the original cemetery, adjacent to the entrance to the 20th century extension.
Muir's main work is Original Sanskrit texts on the origin and history of the people of India, their religion and institutions (1852–1870), a study of the most important source texts of Indian cultural and religious history, with English language translation. In 1858 the first volume of his Original Sanskrit Texts (2nd ed., 1868) was published; it was on the origin of caste, an inquiry intended to show that it did not exist in the Vedic age. The second volume (1st ed., 1860; 2nd, 1871) was concerned with the origin and racial affinities of the Hindus, exhibiting all the then available evidences of their connexion, their linguistic, social and political kinship, with the other branches of the Indo-European stock. The third volume (1st ed., 1861; 2nd, 1868) was on the Vedas, a full inquiry as to the ideas of their origin, authority and inspiration held both by the Vedic and later Indian writers. Volume four (1st ed., 1863; 2nd, 1873) was a comparison of the Vedic with the later representations of the principal Indian deities, an exhibition of the process by which three gods hardly known to the Vedic hymns became the deities of the former Hindu Trimurti. The fifth and final volume was published in 1970 and was on the Vedic mythology. Muir was also the author of a volume of metrical translations from the Sanskrit, an anonymous work on inspiration, several works in Sanskrit, and many essays in the Journal of the Royal Asiatic Society and elsewhere.
In 1839, Muir published Matapariksa: Sketch of the Argument for Christianity and against Hinduism, a work that, in contrast to the vitriolic missionary tracts prevalent at that time, presented Hinduism in empathetic tone and depicted Christianity and Hinduism as more or less compatible, although Christianity was clearly depicted as superior. However while sensitive to "Hindu genius" Muir advanced miracles, moral excellence, and universality as three basic arguments in favor of Christianity. The work was controversial in India and helped launch a counter-apologetic movement among Hindu scholars.
- Muir, John (1861). "Original Sanskrit Texts on the Origin and Progress of the Religion and Institutions of India". Williams and Norgate.
- History of Sampurnanand Sanskrit University
- Chisholm 1911.
- Bendall 1894.
- Bendall, Cecil (1894). "Muir, John". In Lee, Sidney. Dictionary of National Biography. 39. London: Smith, Elder & Co.
- Podgorski, Frank R.; Young, Richard Fox (October 1983). "review of 'Resistant Hinduism: Sanskrit Sources on Anti-Christian Apologetics in Early Nineteenth-Century India' by Richard Fox Young". Philosophy East and West. Philosophy East and West, Vol. 33, No. 4. 33 (4): 417–418. doi:10.2307/1398604. JSTOR 1398604.
- This article incorporates text from a publication now in the public domain: Chisholm, Hugh, ed. (1911). "Muir, John". Encyclopædia Britannica (11th ed.). Cambridge University Press.
- This article incorporates text from a publication now in the public domain: Bendall, Cecil (1894). "Muir, John". In Lee, Sidney. Dictionary of National Biography. 39. London: Smith, Elder & Co.