Birds are the only living amniotes with coloured eggs1,2,3,4, which have long been considered to be an avian innovation1,3. A recent study has demonstrated the presence of both red-brown protoporphyrin IX and blue-green biliverdin5—the pigments responsible for all the variation in avian egg colour—in fossilized eggshell of a nonavian dinosaur6. This raises the fundamental question of whether modern birds inherited egg colour from their nonavian dinosaur ancestors, or whether egg colour evolved independently multiple times. Here we present a phylogenetic assessment of egg colour in nonavian dinosaurs. We applied high-resolution Raman microspectroscopy to eggshells that represent all of the major clades of dinosaurs, and found that egg colour pigments were preserved in all eumaniraptorans: egg colour had a single evolutionary origin in nonavian theropod dinosaurs. The absence of colour in ornithischian and sauropod eggs represents a true signal rather than a taphonomic artefact. Pigment surface maps revealed that nonavian eumaniraptoran eggs were spotted and speckled, and colour pattern diversity in these eggs approaches that in extant birds, which indicates that reproductive behaviours in nonavian dinosaurs were far more complex than previously known3. Depth profiles demonstrated identical mechanisms of pigment deposition in nonavian and avian dinosaur eggs. Birds were not the first amniotes to produce coloured eggs: as with many other characteristics7,8 this is an attribute that evolved deep within the dinosaur tree and long before the spectacular radiation of modern birds.