information:highlighting, stylistic:tone, information:extraction, quality:correction
Papal election

Following the death of Pope Pius XII on 9 October 1958, Roncalli watched the live funeral on his last full day in Venice on 11 October. His journal was specifically concerned with the funeral and the abused state of the late pontiff's corpse. Roncalli left Venice for the conclave in Rome well aware that he was papabile, and after eleven ballots, was elected to succeed the late Pius XII, so it came as no surprise to him, though he had arrived at the Vatican with a return train ticket to Venice.

Many had considered Giovanni Battista Montini, the Archbishop of Milan, a possible candidate, but, although he was the archbishop of one of the most ancient and prominent sees in Italy, he had not yet been made a cardinal. Though his absence from the 1958 conclave did not make him ineligible – under Canon Law any Catholic male who is capable of receiving priestly ordination and episcopal consecration may be elected – the College of Cardinals usually chose the new pontiff from among the Cardinals who attend the papal conclave. At the time, as opposed to modern practice, the participating Cardinals did not have to be below age 80 to vote, there were few Eastern-rite Cardinals, and some Cardinals were just priests at the time of their elevation.

Roncalli was summoned to the final ballot of the conclave at 4:00 pm. He was elected pope at 4:30 pm with a total of 38 votes. After the long pontificate of Pope Pius XII, the cardinals chose a man who – it was presumed because of his advanced age – would be a short-term or "stop-gap" pope. They wished to choose a candidate who would do little during the new pontificate. Upon his election, Cardinal Eugène Tisserant asked him the ritual questions of whether he would accept and if so, what name he would take for himself. Roncalli gave the first of his many surprises when he chose "John" as his regnal name. Roncalli's exact words were "I will be called John". This was the first time in over 500 years that this name had been chosen; previous popes had avoided its use since the time of the Antipope John XXIII during the Western Schism several centuries before.

On the choice of his papal name, Pope John XXIII said to the cardinals:

I will be called John... a name sweet to us because it is the name of our father, dear to us because it is the name of the humble parish church where we were baptized, the solemn name of numberless cathedrals scattered throughout the world, including our own basilica. Twenty-two Johns of indisputable legitimacy have, and almost all had a brief pontificate. We have preferred to hide the smallness of our name behind this magnificent succession of Roman Pontiffs.

Upon his choosing the name, there was some confusion as to whether he would be known as John XXIII or John XXIV; in response, he declared that he was John XXIII, thus affirming the antipapal status of antipope John XXIII.

Before this antipope, the most recent popes called John were John XXII (1316–1334) and John XXI (1276–1277). No Pope John XX existed, owing to confusion caused by medieval historians misreading the Liber Pontificalis to refer to another Pope John between John XIV and John XV.

After his election, he confided in Cardinal Maurice Feltin that he had chosen the name "in memory of France and in the memory of John XXII who continued the history of the papacy in France".

After he answered the two ritual questions, the traditional Habemus Papam announcement was delivered by Cardinal Nicola Canali to the people at 6:08 pm, an exact hour after the white smoke appeared. A short while later, he appeared on the balcony and gave his first Urbi et Orbi blessing to the crowds of the faithful below in Saint Peter's Square. That same night, he appointed Domenico Tardini as his Cardinal Secretary of State. Of the three cassocks prepared for whoever the new pope was, even the largest was not enough to fit his obese frame, which had to be let out in certain places and only to be held together with great effort by bobby pins. When he first saw himself in the mirror in his new vestments, he said with an apprising and critical look that "this man will be a disaster on television!", while later saying he felt his first appearance before the globe was as if he were a "newborn babe in swaddling clothes".

His coronation took place on 4 November 1958, on the feast of Saint Charles Borromeo, and it occurred on the central loggia of the Vatican. He was crowned with the 1877 Palatine Tiara. His coronation ran for the traditional five hours.

In John XXIII's first consistory on 15 December of that same year, Montini was created a cardinal and would become John XXIII's successor in 1963, taking the name of Paul VI. That consistory was notable for being the first to expand the Sacred College membership beyond the then-traditional 70.

Following his election the new pope told the tale of how in his first weeks he was walking when he heard a woman exclaim in a loud voice: "My God, he's so fat!" The new pope casually remarked: "Madame, the holy conclave isn't exactly a beauty contest!"