Currently the accepted number of popes who used the name John is at 21, although the most recently pope named John was John XXIII (reigned 1958 – 1963). Numbering of the Catholic popes named John had some issues, the first 14 (John I through John XIV) did not have any controversy in the numbering. But medieval historians misread the “Liber Pontificalis” (or “Book of Popes”) and believed there was a Pope between John XIV and John XV who was also named John, giving a name “John XIV bis”, then finding later that pope didn’t exist.

The confusion continued when John XVI (papacy 997 – 998) was elected to oppose Pope Gregory V and John XVI is currently considered an antipope, but his number was kept in the sequence. The number 20 (XX) was skipped because when John XXI (1276 – 1277) selected his number, he believed John XV through XIX should have been XVI through XX. The most recent issue with numbering was John XXIII (1410 – 1415) who was listed as a legitimate pope until the mid-20th century. He was slated as an antipope and XXIII was reused by Angelo Roncalli who became Pope John XXIII in 1958.

More Info: en.wikipedia.org