Carbon 12 and carbon 14 dating
The most common form of carbon in the atmosphere is carbon-12, which is a stable isotope of carbon.
An unstable form of carbon isotope, carbon-14, also known as radiocarbon, is formed when cosmic rays hit atoms in the upper atmosphere of the earth.
When cosmic rays collide with the atoms, it creates an energetic neutron, which, upon hitting a nitrogen atom (7 neutrons and 7 protons), creates a carbon-14 atom (6 protons and 8 neutrons) and a hydrogen atom (1 neutron, 0 proton).
Hence, gradually, the ratio of stable carbon to radioactive carbon also decreases.The number is the atomic mass, or the sum of the protons ans neutrons.Carbon 12 (the most common) has 6 protons and 6 neutrons.There are calibration charts as well to account for the change in the amount of carbon-14 content in the atmosphere over the years to diminish errors.Although carbon-14 dating technique has its limitations, still it is a very helpful tool for archaeologists.