Carbon dioxide in the Earth's atmosphere
Carbon dioxide forms approximately 0.04% of the Earth's atmosphere. It is essential to photosynthesis in plants and other photoautotrophs, and is also a prominent greenhouse gas due to its radiative forcing strength.

# Concentration
As of November 2007, the CO2 concentration in Earth's atmosphere was about 0.0384% by volume, or 384 ppmv. This is 100 ppm (35%) above the 1832 ice core levels of 284 ppm . The National Oceanic and Atmospheric Administration defines the current levels in terms of "a dry mole fraction defined as the number of molecules of carbon dioxide divided by the number of molecules of dry air multiplied by one million (ppm)."
There is an annual fluctuation of about 3-9 ppm in the measurements, which roughly follows the Northern Hemisphere's growing season. The Northern Hemisphere dominates the annual cycle of CO2 concentration because it has much greater land area and plant biomass than the Southern Hemisphere. Concentrations peak in May as the spring greenup begins and reach a minimum in October when the quantity of biomass undergoing photosynthesis is greatest.
Despite its relatively small concentration overall in the atmosphere, CO2 is an important component of Earth's atmosphere because it absorbs infrared radiation at wavelengths of 4.26 m (asymmetric stretching vibrational mode) and 14.99 m (bending vibrational mode), thereby playing a role in the greenhouse effect. See also "Carbon dioxide equivalent".
The initial carbon dioxide in the atmosphere of the young Earth was produced by volcanic activity. This was essential for a warm and stable climate conducive to life. Volcanic activity now releases about 130 to 230 teragrams (145 million to 255 million short tons) of carbon dioxide each year,  which is less than 1% of the amount released by human activities.
Burning fossil fuels such as coal and petroleum is the leading cause of increased anthropogenic CO2; deforestation is the second major cause. As of 2004, around 27 gigatonnes of CO2 are released from fossil fuels per year worldwide, equivalent to about 7.4 gigatonnes of carbon (see List of countries by carbon dioxide emissions); in 2006  8.4 gigatonnes carbon were emitted . With some simple calculations based on the surface area of the Earth, normal atmospheric pressure, and an estimate of roughly 400ppmv atmospheric CO2 content one can calculate that the atmospheric CO2 content is currently approximately 3,000 gigatonnes.
Carbon dioxide is released to the atmosphere by a variety of natural sources, and over 95% percent of total CO2 emissions would occur even if humans were not present on Earth. For example, the natural decay of organic material in forests and grasslands, such as dead trees, results in the release of about 220 gigatonnes of carbon dioxide every year. This carbon dioxide alone is over 8 times the amount emitted by humans. These natural sources are balanced by natural sinks, which remove carbon dioxide from the atmosphere. The increase in carbon dioxide concentration arises because the increase from human activity is not balanced by a corresponding sink.
In 1997, Indonesian peat fires may have released 13%  40% as much carbon as fossil fuel burning does in a single year. Various techniques have been proposed for removing excess carbon dioxide from the atmosphere in carbon dioxide sinks. Not all the emitted CO2 remains in the atmosphere; some is absorbed in the oceans or biosphere. The ratio of the increase in atmospheric CO2 to emitted CO2 is known as the airborne fraction (Keeling et al., 1995); this varies for short-term averages but is typically 57% over longer (5 year) periods.
Increased amounts of CO2 in the atmosphere enhance the greenhouse effect. It is currently the majority scientific opinion that carbon dioxide emissions are the main cause of global warming observed since the mid-20th century. The effect of combustion-produced carbon dioxide on climate is occasionally called the Callendar effect, after engineer and inventor Guy Stewart Callendar who was one of the first to propose this association (in 1938).

# Origins
Natural sources of atmospheric carbon dioxide include volcanic outgassing, the combustion of organic matter, and the respiration processes of living aerobic organisms; man-made sources of carbon dioxide include the burning of fossil fuels for heating, power generation and transport. It is also produced by various microorganisms from fermentation and cellular respiration. Plants convert carbon dioxide to carbohydrates during a process called photosynthesis. They produce the energy needed for this reaction through the photolysis of water. The resulting gas, oxygen, is released into the atmosphere by plants, which is subsequently used for respiration by heterotrophic organisms, forming a cycle.
During the 100,000 year ice age cycle, CO2 varies between a low of approximately 200 ppm during cold periods and a high of 280 ppm during interglacials. Recent human influences have increased this to above 380 ppm. There is a large natural flux of CO2 into and out of the biosphere and oceans. In the pre-industrial era these fluxes were largely in balance. Currently approximately 50% of human-emitted CO2 is removed; without this effect CO2 levels would be even higher.

# Historical variation
The most direct method for measuring atmospheric carbon dioxide concentrations for periods before direct sampling is to measure bubbles of air (fluid or gas inclusions) trapped in the Antarctic or Greenland ice caps. The most widely accepted of such studies come from a variety of Antarctic cores and indicate that atmospheric CO2 levels were about 260  280 ppmv immediately before industrial emissions began and did not vary much from this level during the preceding 10,000 years (10 kyr).
The longest ice core record comes from East Antarctica, where ice has been sampled to an age of 800 kyr BP (Before Present). During this time, the atmospheric carbon dioxide concentration has varied by volume between 180  210 ppm during ice ages, increasing to 280  300 ppm during warmer interglacials. The data can be accessed here.
Some studies have disputed the claim of stable CO2 levels during the present interglacial of the last 10 kyr. Based on an analysis of fossil leaves, Wagner et al. argued that CO2 levels during the period 7  10 kyr ago were significantly higher (~300 ppm) and contained substantial variations that may be correlated to climate variations. Others have disputed such claims, suggesting they are more likely to reflect calibration problems than actual changes in CO2. Relevant to this dispute is the observation that Greenland ice cores often report higher and more variable CO2 values than similar measurements in Antarctica. However, the groups responsible for such measurements (e.g., Smith et al.) believe the variations in Greenland cores result from in situ decomposition of calcium carbonate dust found in the ice. When dust levels in Greenland cores are low, as they nearly always are in
Antarctic cores, the researchers report good agreement between Antarctic and Greenland CO2 measurements.
On longer timescales, various proxy measurements have been used to attempt to determine atmospheric carbon dioxide levels millions of years in the past. These include boron and carbon isotope ratios in certain types of marine sediments, and the number of stomata observed on fossil plant leaves. While these measurements give much less precise estimates of carbon dioxide concentration than ice cores, there is evidence for very high CO2 volume concentrations between 200 and 150 myr BP of over 3,000 ppm and between 600 and 400 myr BP of over 6,000 ppm. On long timescales, atmospheric CO2 content is determined by the balance among geochemical processes including organic carbon burial in sediments, silicate rock weathering, and vulcanism. The net effect of slight imbalances in the carbon cycle over tens to hundreds of millions of years has been to reduce atmospheric CO2. The rates of these processes are extremely slow; hence they are of limited relevance to the atmospheric CO2 response to emissions over the next hundred years. In more recent times, atmospheric CO2 concentration continued to fall after about 60 myr BP, and there is geochemical evidence that volume concentrations were less than 300 ppm by about 20 myr BP. Low CO2 concentrations may have been the stimulus that favored the evolution of C4 plants, which increased greatly in abundance between 7 and 5 myr BP. Present carbon dioxide levels are likely higher now than at any time during the past 20 myr and certainly higher than in the last 800,000.
It must be noted that although CO2 concentrations have been significantly higher in the distant past than they are today, the energy output of the sun has also steadily increased over the same period. It is projected to continue to do so long into the future, according to theories concerning the formation and evolution of the Solar System.

# Relationship with oceanic concentration
The Earth's oceans contain a huge amount of carbon dioxide in the form of bicarbonate and carbonate ions  much more than the amount in the atmosphere. The bicarbonate is produced in reactions between rock, water, and carbon dioxide. One example is the dissolution of calcium carbonate:
Reactions like this tend to buffer changes in atmospheric CO2. However, since it produces an acidic compound, the pH of sea water is thought to go down with increasing carbon dioxide levels. Reactions between carbon dioxide and non-carbonate rocks also add bicarbonate to the seas, which can later undergo the reverse of the above reaction to form carbonate rocks, releasing half of the bicarbonate as CO2. Over hundreds of millions of years this has produced huge quantities of carbonate rocks.
The vast majority of CO2 added to the atmosphere will eventually be absorbed by the oceans and become bicarbonate ion, but the process takes on the order of a hundred years because most seawater rarely comes near the surface.
As the oceans warm, carbon dioxide solubility in the surface waters decreases markedly. However, the overall system is quite complex, as indicated above, and further details may be found in the article on the carbon solubility pump.
An unknown, though probably large,  quantity of CO2 is in the ocean sediments as a methane-carbon dioxide-water clathrates, one of the family of gas hydrates.