Carbon comes from the triple alpha process that occurs in the cores of giant or supergiant stars. This is a triple collision of helium nuclei. Because the conditions this required couldn't happen during the creation of the universe, all carbon was made after the Big Bang.
The element can also be found in smaller stars such as the sun and other extraterrestrial bodies, including comets and meteorites. It is found in a free state on Earth as graphite, amorphous carbon or diamond. Many planets also have carbon in their atmospheres.
Carbon is not as abundant as hydrogen, helium or oxygen, and is not very common in the Earth's crust. In its pure form, it is also surprisingly non-reactive. Yet it is found in all living things and is the basis for organic chemistry. This is the study of the many types of carbon compounds. As of 2014, over 10 million carbon compounds have been discovered.
The allotropes of carbon are very stable, but they're remarkably different. Diamond is transparent and is one of the hardest substances known, while graphite is soft and opaque.
Carbon's atomic number is 6 and its atomic weight is 12.0107. It's been known since ancient times but wasn't isolated as an element until the early 1800s.