John XII was born Octavianus, the son of Alberic II of Spoleto, Patrician and self-styled prince of Rome.
With the death of Pope Agapetus II in November 955, Octavianus, who was the Cardinal deacon of the deaconry of Santa Maria in Domnica, was elected his successor on 16 December 955.