He was born of humble parents at Schilpario in what is now the province of Bergamo, Lombardy. In 1799 he entered the Society of Jesus, and in 1804 he became a teacher of classics in the college of Naples. After completing his studies at the Collegium Romanum, he lived for some time at Orvieto, where he was engaged in teaching and palaeographical studies. The political events of 1808, when French troops occupied the Papal States, necessitated his withdrawal from Rome to Milan, where in 1813 he was made custodian of the Ambrosian library. He now threw himself with characteristic energy and zeal into the task of examining the numerous manuscripts committed to his charge, and in the course of the next six years was able to restore to the world a considerable number of long-lost works. Having withdrawn from the Society of Jesus, he was invited to Rome in 1819 as chief keeper of the Vatican Library. In 1833 he was transferred to the office of secretary of the Congregation of the Propaganda; on February 12, 1838, he was raised to the dignity of cardinal. He died at Castel Gandolfo, near Albano, on 8 September1854. His monumental tomb is located in the left transept of the Basilica di Sant'Anastasia al Palatino by the late neoclassical sculptor Giovanni Maria Benzoni. It is on his skill as a reader of palimpsests that Mai's fame chiefly rests. To the period of his residence at Milan belong:
fragments of Cicero's Pro Scauro, Pro Tullio, Pro Flacco, In Clodium et Curionem, De aere alieno Milonis, and De rege Alexandrino
M. Corn. Frontonis opera inedita, cum epistolis item ineditis, Antonini Pii, Marci Aurelii, Lucii Veri et Appiani
M Tullii Ciceronis de republica quae supersunt appeared at Rome in 1822
Scriptorum veterum nova collectio, e Vaticanis codicibus edita in 1825-1838
Classici scriptores e Vaticanis codicibus editi in 1828-1838
Spicilegium Romanum in 1839-1844
Patrum nova bibliotheca in 1845-1853
His edition of the celebrated Codex Vaticanus, completed in 1838, but not published till four years after his death, is the least satisfactory of his labours and was superseded by the edition of Vercellone and Cozza, which itself leaves much to be desired. Although Mai was not as successful in textual criticism as in the decipherment of manuscripts, he will always be remembered as a laborious and persevering pioneer, by whose efforts many ancient writings have been rescued from oblivion.