Carbon has 3 isotopes in nature: carbon-12, carbon-13 and carbon-14.
The average atomic mass of carbon, which is the one found in the periodic table, can be calculated as follows:
(average mass of 12C x its percentage of abundance) +
(average mass of 13C x its percentage of abundance) +
(average mass of 14C x its percentage of abundance)
Since carbon-12 is the most abundant one, therefore, the average mass is closest to 12, however, other isotopes (carbons having more than 12 neutrons) are also taken into consideration.