The Code of Justinian (Latin: Codex Justinianus, Justinianeus or Justiniani) is one part of the Corpus Juris Civilis, the codification of Roman law ordered early in the 6th century AD by Justinian I, who was Eastern Roman emperor in Constantinople. Two other units, the Digest and the Institutes, were created during his reign. The fourth part, the Novellae Constitutiones (New Constitutions, or Novels), was compiled unofficially after his death but is now also thought of as part of the Corpus Juris Civilis.
 Shortly after Justinian became emperor in 527, he decided the empire's legal system needed repair. There existed three codices of imperial laws and other individual laws, many of which conflicted or were out of date. The Codex Gregorianus and the Codex Hermogenianus were unofficial compilations.  (The term "Codex" refers to the physical aspect of the works, being in book form, rather than on papyrus rolls. The transition to the codex occurred around AD 300.) The Codex Theodosianus was an official compilation ordered by Theodosius II. In February 528, Justinian promulgated the constitution Hac quae necessario, by which was created a ten-man commission to review these earlier compilations as well as individual laws, eliminate everything unnecessary or obsolete, make changes as it saw fit, and create a single compilation of imperial laws in force. The commission was headed by the praetorian prefect John the Cappadocian and also included Tribonian, who was later to head the other Corpus Juris Civilis projects.
 The commission finished its work in 14 months, and the compilation was promulgated in April 529 by the Constitutio Summa. However, this compilation did not eliminate all the conflicts that had arisen over the years in Roman jurisprudence, and the constitutions in the Code were to be used alongside the conflicting opinions of ancient jurists. "The citation of the said constitutions of Our Code, with the opinions of the ancient interpreters of the law, will suffice for the disposal of all cases." Justinian attempted to harmonize these conflicting opinions by issuing his "Fifty Decisions" and by passing additional new laws. This meant that his Code no longer reflected the latest imperial law. Thus, Justinian ordered a new compilation to supersede the first, and this Codex was published in 534. No copies of the first edition of the Code have survived; only a fragment of an index of contents on an Egyptian papyrus remains. Known as the Codex Repetitae Praelectionis, this second edition of the Code was published on November 16, 534, and took effect on December 30. The Codex consists of twelve books: book 1 concerns ecclesiastical law, sources of law, and the duties of higher offices; books 2–8 cover private law; book 9 deals with crimes; and books 10–12 contain administrative law. The Code's structure is based on ancient classifications set out in the edictum perpetuum (perpetual edict), as is that of the Digest.
 In the West, Justinian's Codex was largely lost, or in many places never present, due to the limited western extent of the Roman territories. The Latin version known today was painstakingly restored over many centuries. The only known manuscript that once contained the entire Latin Codex is a Veronese palimpsest of the 6th or 7th century; it is now only fragments. Within its home in the Roman Empire, the code was translated into Greek, which had become the governing language, and adapted, in the 9th century as the Basilika. It appears as if the Latin Code was shortened in the Middle Ages into an "Epitome Codex", with inscriptions being dropped and numerous other changes made. Some time in the 8th or 9th century, the last three books of the Code were separated from the others, and many other laws in the first nine books, including all of those written in Greek, were dropped. Substantially complete versions of Justinian's Codex were restored around the end of the 12th century, and the humanists of the 16th century added the laws originally promulgated in Greek. Paul Krüger created the modern, standard version of the Codex in 1877.
 No English translations were made of the Codex until the 20th century. In 1932, the English translation of the entire Corpus Juris Civilis (CJC) by Samuel Parsons Scott was published posthumously. Unfortunately, Scott used the Kriegel brothers' edition of the CJC rather than that of Theodor Mommsen, Paul Krüger, Rudolf Schöll and Wilhelm Kroll, which is accepted as the most reliable, and his translation was severely criticized. Reviewing Scott's work, the Roman law scholar W. W. Buckland wrote that Scott "...had at his disposal an adequate latinity and has produced a version written in an English which can be read with pleasure. But much more than that was needed, and the work cannot be said to satisfy these further requirements." Around the same time that Scott was active, Wyoming Supreme Court Justice Fred H. Blume was translating the Code and Novels, using the standard  Mommsen, Krüger, Schöll, and Kroll version. While this was not printed in his lifetime, in 2005 his translation of both the Code and the Novels was published on the Annotated Justinian Code website. A new English translation of the Codex, based on Blume's, was published in October 2016.