Carbon dating is a variety of radioactive dating which is applicable only to matter which was once living and presumed to be in equilibrium with the atmosphere, taking in carbon dioxide from the air for photosynthesis.
Carbon has three naturally occouring isotopes,C-12,C-13,and C-14, of which C-12 and C-13 are stable ( occour in the preportion 99:1.).It is formed when cosmic rays (neutrons) hit atmospheric nitrogen.It is found in traces.It has a half life of about 5700 years.So when a plant takes up carbondioxide contaning C-14,it reaches animals and finally humans through food chain.When an organism dies no more C-14 reaches into its body.And the amount of C-14 in its body starts to decay slowly into nitrogen-14 through beta decay.As I told you earlier that it is found in traces,so the initial amount is usually taken as one gram and its final concentration is calculated.The amount of C-14 decayed thus gives the age of fossils etc...