Book of the Dead is the common name for ancient Egyptian funerary texts known as The Book of Coming or Going Forth By Day. The name "Book of the Dead" was the invention of the German Egyptologist Karl Richard Lepsius, who published a selection of some texts in 1842.
The Books were text initially carved on the exterior of the deceased person's sarcophagus, but was later written on papyrus now known as scrolls and buried inside the sarcophagus with the deceased, presumably so that it would be both portable and close at hand. Other texts often accompanied the primary texts including the hypocephalus (meaning 'under the head') which was a primer version of the full text.
Books of the Dead constituted as a collection of spells, charms, passwords, numbers and magical formulas for the use of the deceased in the afterlife. This described many of the basic tenets of Egyptian mythology.
They were intended to guide the dead through the various trials that they would encounter before reaching the underworld. Knowledge of the appropriate spells was considered essential to achieving happiness after death. Spells or enchantments vary in distinctive ways between the texts of differing "mummies" or sarcophagi, depending on the prominence and other class factors of the deceased.
Books of the Dead were usually illustrated with pictures showing the tests to which the deceased would be subjected. The most important was the weighing of the heart of the dead person against Ma'at, or Truth (carried out by Anubis). The heart of the dead was weighed against a feather, and if the heart was not weighed down with sin (if it was lighter than the feather) he was allowed to go on. The god Thoth would record the results and the monster Ammit would wait nearby to eat the heart should it prove unworthy.
The earliest known versions date from the 16th century BC during the 18th Dynasty (ca. 1580 BC1350 BC). It partly incorporated two previous collections of Egyptian religious literature, known as the Coffin Texts (ca. 2000 BC) and the Pyramid Texts (ca. 2600 BC-2300 BC), both of which were eventually superseded by the Book of the Dead.
The text was often individualized for the deceased person - so no two copies contain the same text - however, "book" versions are generally categorized into four main divisions - the Heliopolitan version, which was edited by the priests of the college of Annu (used from the 5th to the 11th dynasty and on walls of tombs until about 200); the Theban version, which contained hieroglyphics only (20th to the 28th dynasty); a hieroglyphic and hieratic character version, closely related to the Theban version, which had no fixed order of chapters (used mainly in the 20th dynasty); and the Saite version which has strict order (used after the 26th dynasty).
It is notable, that the Book of the Dead for Scribe Ani, the Papyrus of Ani, was originally 78 Ft, and was separated into 37 sheets at appropriate chapter and topical divisions.