One of the best preserved was the ancient Ulpian Library built by the Emperor Trajan. Completed in 112/113 AD, the Ulpian Library was part of Trajan's Forum built on the Capitoline Hill. Trajan's Column separated the Greek and Latin rooms which faced each other. The structure was approximately fifty feet high with the peak of the roof reaching almost seventy feet.

The Library of Celsus in Ephesus, Anatolia, now part of Selçuk, Turkey was built in honor of the Roman Senator Tiberius Julius Celsus Polemaeanus by Celsus' son, Tiberius Julius Aquila Polemaeanus. The library was built to store 12,000 scrolls and to serve as a monumental tomb for Celsus. The library's ruins were hidden under debris of the city of Ephesus that was deserted in early Middle Ages.

During Sassanid Empire collection of books drew the attention of rulers and priests. Priests intended to gather the spread and unknown Zoroastrianism manuscripts and rulers were keen on collection and promotion of science. Many Zoroastrian temples were accompanied by a library that was designed to collect and promote religious content.

The Imperial Library of Constantinople was an important depository of ancient knowledge. Constantine himself wanted such a library but his short rule denied him the ability to see his vision to fruition. His son Constantius II made this dream a reality and created an imperial library in a portico of the royal palace. At its height in the 5th century, the Imperial Library of Constantinople had 120,000 volumes and was the largest library in Europe. A fire in 477 consumed the entire library but it was rebuilt only to be burned again in 726, 1204, and in 1453 when Constantinople fell to the Ottoman Turks.

Also, in Eastern Christianity monastery libraries kept important manuscripts. The most important of them were the ones in the monasteries of Mount Athos for Orthodox Christians, and the library of the Saint Catherine's Monastery in the Sinai Peninsula, Egypt for the Coptic Church.

The first libraries in Muslim lands were not necessarily for the public, but they contained much knowledge. The need for the preservation of the Quran, the Muslim holy book, and the Traditions of Muhammad, the prophet of Islam, is what led to the collection of writings in the Muslim world. Where traditions and history used to be oral, the need to preserve the words of the Quran necessitated a method of preserving the words by some means other than orally. Mosques that were the center of everything in a Muslim society's day-to-day life became also libraries that stored and preserved all knowledge, from the Quran to books on religion, philosophy and science. By the 8th century, first Iranians and then Arabs had imported the craft of papermaking from China, with a paper mill already at work in Baghdad in 794 then called Bagdatikos.

The 9th-century Abbasid Caliph al-Mutawakkil of Iraq, ordered the construction of a "zawiyat qurra" – an enclosure for readers which was "lavishly furnished and equipped".

By the 9th century, public libraries started to appear in many Islamic cities. They were called "halls of Science" or dar al-'ilm. They were each endowed by Islamic sects with the purpose of representing their tenets as well as promoting the dissemination of secular knowledge. In Baghdad, the library was known as the House of Wisdom.

In the Early Middle Ages, monastery libraries developed, such as the important one at the Abbey of Montecassino in Italy. Books were usually chained to the shelves, reflecting the fact that manuscripts, which were created via the labour-intensive process of hand copying, were valuable possessions.

The first libraries appeared five thousand years ago in Southwest Asia's Fertile Crescent, an area that ran from Mesopotamia to the Nile in Africa. Known as the cradle of civilization, the Fertile Crescent was the birthplace of writing, sometime before 3000 BC.

The Library of Abu-Nasr Shapur Ibn Ardeshir- Baghdad- 10th century: Abu-Nasr who was a Daylamites’ Minister, founded a mega well-known public library in Baghdad that is claimed to hold 10 thousand volumes. The library was destroyed during Baghdad's big fire.

Nuh Ibn Mansour Samani Library- Bukhara-10th century: Samanid Empire rulers were famous for showing a considerable passion for culture and science and their consistent support for promoting libraries. Nuh II had a sizable library. Avicenna who was one of the visitors to Mansour's library in Bukhara has described it as extraordinary in terms of the number of volumes and the value of books. Looking for a certain item in medicine, he requested an entry permit from the Sultan to browse the library storage space. The book stack had been composed of plenty of rooms, each room had contained numerous boxes and each box had been filled with stacks of books as he reported.

Sahib ibn Abbad Library-Rey- 10th century- The Iranian Grand Vizier to Buyid rulers established a legendary public library holding around 200,000 volumes. Ibn Abbad who was so proud of this great collection of books once refused the invitation of Samanid rulers to become their Grand Vizier in Bukhara, giving the excuse of attachment to his books that would need around 400 camels to carry on. The library was partially destroyed in 1029 by the troops of the Ghaznavids. As evidence to a large amount of the resources, some scholars claimed that just the library catalogue was equal to 10 volumes.

In 1212 the council of Paris condemned those monasteries that still forbade loaning books, reminding them that lending is "one of the chief works of mercy".

Rab'-e Rashidi Library-Maragheh-14th century: Rashid al-Din Hamadani, the Iranian author of Universal History and the Grand Vizier of Sultan Ghazan, was a talented founder of charitable Rab'-e Rashidi Complex and Library. He has elaborated the conditions of using the library resources in a remaining valuable Deed for Endowment (Vaghfnameh) which is of great importance in regards to the applied administrative procedures for running the libraries during the Islamic period: “This public library (Dar al-Masahef) shall deliver service to researchers for the purpose of studying and copying the resources. Books are allowed to be used within the library. Taking out the library books requires some refundable deposit equates to the half value of the borrowed item. The loan period is not allowed to exceed one month. The borrowed item shall get stamped by the librarian in order to be recognized as the property of the library”.

The first libraries consisted of archives of the earliest form of writing – the clay tablets in cuneiform script discovered in temple rooms in Sumer, some dating back to 2600 BC.

The Austrian National Library was founded in Vienna.

The Ming Dynasty in 1407 founded the imperial library, the Wen Yuan Pavilion. It also sponsored the massive compilation of the Yongle Encyclopedia, containing 11,000 volumes including copies of over 7000 books. It was soon destroyed, but similar very large compilations appeared in 1725 and 1772.

From the 15th century in central and northern Italy, libraries of humanists and their enlightened patrons provided a nucleus around which an "academy" of scholars congregated in each Italian city of consequence. Malatesta Novello, lord of Cesena, founded the Malatestiana Library.

The Republic of Venice patronized the foundation of the Biblioteca Marciana, based on the library of Cardinal Basilios Bessarion.

In Rome, the papal collections were brought together by Pope Nicholas V, in separate Greek and Latin libraries, and housed by Pope Sixtus IV, who consigned the Bibliotheca Apostolica Vaticana to the care of his librarian, the humanist Bartolomeo Platina in February 1475.

The Hungarian Bibliotheca Corviniana was one of the first and largest Renaissance Greek-Latin libraries, established by Matthias Corvinus, King of Hungary between 1458 and 1490. In 1490, the library consisted of about 3,000 codices or "Corvinae". Beatrix of Aragon, Queen of Hungary, encouraged his work with the Bibliotheca Corviniana. After Matthias' death in 1490 many of the manuscripts were taken from library and dispersed, subsequently the Turkish invasion of Hungary in the 16th century saw the remaining valuable manuscripts taken to Turkey.

In the 16th century Sixtus V bisected Bramante's Cortile del Belvedere with a cross-wing to house the Apostolic Library in suitable magnificence.

This trend soon spread outside of Italy, for example Louis III, Elector Palatine founded the Bibliotheca Palatina of Heidelberg.

Tianyi Chamber, founded in 1561 by Fan Qin during the Ming Dynasty, is the oldest existing library in China. In its heyday it boasted a collection of 70,000 volumes of antique books.

The 16th and 17th centuries saw other privately endowed libraries assembled in Rome: the Vallicelliana, formed from the books of Saint Filippo Neri, with other distinguished libraries such as that of Cesare Baronio.

Cosimo de Medici in Florence established his own collection, which formed the basis of the Laurentian Library.

The 17th and 18th centuries include what is known as a golden age of libraries; during this some of the more important libraries were founded in Europe. Francis Trigge Chained Library of St. Wulfram's Church, Grantham, Lincolnshire was founded in 1598 by the rector of nearby Welbourne.

Thomas Bodley founded the Bodleian Library, which was open to the "whole republic of the learned".

The Biblioteca Angelica founded by the Augustinian Angelo Rocca, which was the only truly public library in Counter-Reformation Rome.

In Milan Cardinal Federico Borromeo founded the Biblioteca Ambrosiana.

The Załuski Library was founded in Warsaw.

The Bibliothèque Mazarine was initially the personal library of cardinal Mazarin, who was a great bibliophile. At his death he bequeathed his library, which he had opened to scholars since 1643, to the Collège des Quatre-Nations which he had founded in 1661.

But this golden age was not just some prosaic period of great expansion to the number and accessibility of the libraries of Europe; it was also a period of great conflict. The Reformation did not just inspire a redistribution of power but also a redistribution of wealth and knowledge. While the Thirty Years War (1618–1648) decimated the population of Europe (from 21 million at the beginning of the conflict to 13 million by the end) it also aided in the redistribution of this wealth and knowledge.

Chetham's Library in Manchester, which claims to be the oldest public library in the English-speaking world, opened in 1653.

The Prussian State Library was founded in Berlin.

Biblioteca Alessandrina with which Pope Alexander VII endowed the University of Rome.

Innerpeffray Library was the first lending library in Scotland. It is located in the hamlet of Innerpeffray, by the River Earn in Perth and Kinross, 4 miles (6 kilometres) southeast of Crieff.

The Biblioteca Casanatense is a large historic library in Rome, Italy, named in honour of Cardinal Girolamo Casanate whose private library is at its roots.

the National Central Library was founded in Florence.

In the American colonies, the Library Company of Philadelphia was started in 1731 by Benjamin Franklin in Philadelphia, PA.

The British Museum was established in 1753 and had a library containing over 50,000 books.

The M.E. Saltykov-Shchedrin State Public Library was founded in St Petersburg.

The late 18th century saw a rise in subscription libraries intended for the use of tradesmen. In 1797, there was established at Kendal the Economical Library, "designed principally for the use and instruction of the working classes".

The Liverpool Subscription library was a gentlemen only library. In 1798, it was renamed the Athenaeum when it was rebuilt with a newsroom and coffeehouse. It had an entrance fee of one guinea and an annual subscription of five shillings. An analysis of the registers for the first twelve years provides glimpses of middle-class reading habits in a mercantile community at this period. The largest and most popular sections of the library were history, antiquities, and geography, with 283 titles and 6,121 borrowings, and belles-lettres, with 238 titles and 3,313 borrowings.

The Library of Congress was established on 24 April 1800, when president John Adams signed an act of Congress providing for the transfer of the seat of government from Philadelphia to the new capital city of Washington.

The Bibliothèque Sainte-Geneviève was also founded in Paris, was built between 1838 and 1851 by architect Henri Labrouste.

Although by the mid-19th century England could claim 274 subscription libraries and Scotland, 266, the foundation of the modern public library system in Britain is the Public Libraries Act 1850.

Salford Museum and Art Gallery first opened in November 1850 as "The Royal Museum & Public Library", as the first unconditionally free public library in England.

In 1912, the town of Leipzig, seat of the annual Leipzig Book Fair, the Kingdom of Saxony and the Börsenverein der Deutschen Buchhändler (Association of German booksellers) agreed to found a German National Library in Leipzig. Starting 1 January 1913, all publications in German were systematically collected (including books from Austria and Switzerland).

Modernist architects like Alvar Aalto put great emphasis on the comfort and usability of library spaces. The Municipal Library he built 1958–62 for the German city of Wolfsburg features a great central room for which he used a series of specially designed skylights to bring in natural light, even though all the walls are covered with books.

In the 21st Century, libraries continue to change and evolve to match new trends involving the way that patrons consume books and other media. More than ever, the 21st Century library is the digital library. As of 2016, over 90% of public libraries have e-book collections, and over 25% circulate e-readers or tablets. Librarians are increasingly responsible for both physical and digital collections. A digital collection can include sources created and distributed digitally, to physical documents scanned and provided in a digital format. Digital libraries bring with them a whole host of new challenges such as: how the resources are distributed to patrons, whether or not authentication is required and the compatibility of patron hardware or software. Additionally new trends attract patrons to libraries for purposes other than books. The Maker Movement and Maker-spaces are a new trend designed to foster creativity and provide a space for library users to tinker, invent and socialize. Maker-spaces feature both high and low-tech media, though many focus on advanced technology such as 3D Printers or Virtual Reality and making them available to users who might normally not have access to them. Many might also feature Video and Audio recording studios, complete with advanced computers to help users edit their creations.

The earliest discovered private archives were kept at Ugarit; besides correspondence and inventories, texts of myths may have been standardized practice-texts for teaching new scribes. There is also evidence of libraries at Nippur about 1900 BC and those at Nineveh about 700 BC showing a library classification system.

Over 30,000 clay tablets from the Library of Ashurbanipal have been discovered at Nineveh, providing modern scholars with an amazing wealth of Mesopotamian literary, religious and administrative work. Among the findings were the Enuma Elish, also known as the Epic of Creation, which depicts a traditional Babylonian view of creation, the Epic of Gilgamesh, a large selection of "omen texts" including Enuma Anu Enlil which "contained omens dealing with the moon, its visibility, eclipses, and conjunction with planets and fixed stars, the sun, its corona, spots, and eclipses, the weather, namely lightning, thunder, and clouds, and the planets and their visibility, appearance, and stations", and astronomic/astrological texts, as well as standard lists used by scribes and scholars such as word lists, bilingual vocabularies, lists of signs and synonyms, and lists of medical diagnoses.

Persia at the time of the Achaemenid Empire (550–330 BC) was home to some outstanding libraries. Those libraries within the kingdom had two major functions: the first came from the need to keep the records of administrative documents including transactions, governmental orders, and budget allocation within and between the Satrapies and the central ruling State. The second function was to collect precious resources on different subjects of science and sets of principles e.g. medical science, astronomy, history, geometry and philosophy.

The Library of Alexandria, in Egypt, was the largest and most significant great library of the ancient world. It flourished under the patronage of the Ptolemaic dynasty and functioned as a major center of scholarship from its construction in the 3rd century BC until the Roman conquest of Egypt in 30 BC.

Libraries were filled with parchment scrolls as at Library of Pergamum and on papyrus scrolls as at Alexandria: the export of prepared writing materials was a staple of commerce. The Library of Pergamum in Pergamum, Turkey, was one of the most important libraries in the ancient world.

In 213 BC during the reign of Emperor Qin Shi Huang most books were ordered destroyed. The Han Dynasty (202 BC – 220 AD) reversed this policy for replacement copies, and created three imperial libraries. Liu Xin a curator of the imperial library was the first to establish a library classification system and the first book notation system. At this time the library catalog was written on scrolls of fine silk and stored in silk bags. Important new technological innovations include the use of paper and block printing.

In the West, the first public libraries were established under the Roman Empire as each succeeding emperor strove to open one or many which outshone that of his predecessor. Rome's first public library was established by Asinius Pollio. Pollio was a lieutenant of Julius Caesar and one of his most ardent supporters. After his military victory in Illyria, Pollio felt he had enough fame and fortune to create what Julius Caesar had sought for a long time: a public library to increase the prestige of Rome and rival the one in Alexandria.