The NLR is currently ranked among the world’s major libraries. It has the second richest library collection in the Russian Federation, a treasury of national heritage, and is the All-Russian Information, Research and Cultural Center.
The Imperial Public Library was established in 1795 by Catherine the Great, whose private collections included the domestic libraries of Voltaire and Diderot, which she had purchased from their heirs. Voltaire's personal library is still one of the highlights of the collection.
A site for the building was found at the corner of Nevsky Avenue and Sadovaya Street, right in the center of the Russian Imperial capital. The construction work began immediately and lasted for almost fifteen years. The building was designed in a Neoclassical style by architect Yegor Sokolov (built between 1796–1801). The cornerstone of the foreign-language department came from the Polish-Lithuanian Commonwealth in the form of Załuski's Library (420,000 volumes), nationalized by the Russian government at the time of the partitions. The Polish-language books from the library (numbering some 55,000 titles) were returned to Poland by the Russian SFSR in 1921.
In 1810, Emperor Alexander I approved Russia’s first library law stipulating, among other things, that two legal copies of all printed matter in Russia be deposited in the Library. The Library was to be opened for the public in 1812 but, as the more valuable collections had to be evacuated because of Napoleon’s invasion, the inauguration was postponed for two years.
Under Count Alexander Stroganov, who managed the library during the first decade of the 19th century, the Rossica project was inaugurated, a vast collection of foreign books touching on Russia. It was Stroganov who secured for the library some of its most invaluable treasures, namely the Ostromir Gospel, the earliest book written in Russian language, and the Hypatian Codex of the Russian Primary Chronicle. The National Library began a large-scale digitization project at the end of the 20th century. By 2012 the Library, along with its counterpart in Moscow, had around 80,000 titles available electronically.