Carbon: geological information
Carbon is found free in nature in three allotropic forms: amorphous, graphite, and diamond. Graphite is one of the softest known materials while diamond is one of the hardest. Carbon, as microscopic diamonds, is found in some meteorites. Natural diamonds are found in kimberlite of ancient volcanic "pipes" such as found in South Africa. Diamonds are also recovered from the ocean floor off the Cape of Good Hope.
Carbon is distributed very widely in nature as calcium carbonate (limestone). Coal, petroleum, and natural gas are chiefly hydrocarbons. Carbon is found as carbon dioxide in the atmosphere of the earth and dissolved in all natural waters. The atmosphere of Mars contains 96% CO2. It is plentiful in the sun, stars, comets, and the atmospheres of most planets.
Abundances of carbon in various environments
In this table of abundances, values are given in units of ppb (parts per billion; 1 billion = 109), both in terms of weight and in terms of numbers of atoms. Values for abundances are difficult to determine with certainty, so all values should be treated with some caution, especially so for the less common elements. Local concentrations of any element can vary from those given here an orders of magnitude or so and values in various literature sources for less common elements do seem to vary considerably.
The chart above shows the log of the abundance (on a parts per billion scale) of the elements by atom number in our sun. Notice the "sawtooth" effect where elements with even atomic numbers tend to be more strongly represented than those with odd atomic numbers. This shows up best using the "Bar chart" option on the chart.