A codex (from the Latincaudex, meaning "trunk of a tree", “block of wood” or “book”), plural codices (z/), is a book constructed of a number of sheets of paper, vellum, papyrus, or similar materials. The term is now usually only used of manuscript books, with hand-written contents, but describes the format that is now near-universal for printed books in the Western world. The book is usually bound by stacking the pages and fixing one edge to a spine, which may just be thicker paper (paperback or softback), or with stiff boards, called a hardback, or in elaborate historical examples a treasure binding.
At least in the Western world, the main alternative to the paged codex format for a long document is the continuous scroll, which was the dominant form of document in the Ancient World. Some codices are continuously folded like a concertina, in particular the Maya codices and Aztec codices, which are actually long sheets of paper or animal skin folded into pages. These do not really meet most current definitions of the "codex" form, but are so called by convention.
The Romans developed the form from wax tablets. The gradual replacement of the scroll by the codex has been called the most important advance in book making before the invention of the printing press. The codex transformed the shape of the book itself, and offered a form that lasted until the present day (and continues to be used alongside e-paper). The spread of the codex is often associated with the rise of Christianity, which adopted the format for use with the Bible early on. First described by the 1st-century AD Roman poet Martial, who praised its convenient use, the codex achieved numerical parity with the scroll around 300 AD, and had completely replaced it throughout what was by then a Christianized Greco-Roman world by the 6th century.
The change from rolls to codices roughly coincides with the transition from papyrus to parchment as the preferred writing material, but the two developments are unconnected. In fact, any combination of codices and scrolls with papyrus and parchment is technically feasible and common in the historical record.
The codex began to replace the scroll almost as soon as it was invented. In Egypt, by the fifth century, the codex outnumbered the scroll by ten to one based on surviving examples. By the sixth century, the scroll had almost vanished as a medium for literature.