The Earth formed approximately 4.5 billion years ago, along with the other seven planets in the solar system. As the Earth cooled, a primitive atmosphere was created by the out-gassing of early volcanoes. The early atmosphere contained no oxygen and would have been toxic to human beings, as well as most other life on Earth today.
Hydrogen and Helium
Earth is believed to have formed from gas and dust orbiting the sun. The vast majority of the gas would have been composed of the lighter elements, such as hydrogen and helium. The early Earth had a large amount of hydrogen and helium in the atmosphere and this would have slowly escaped into space due to the low mass of these gases. Today, hydrogen and helium make up less than 1 percent of the Earth's atmosphere.
Water vapor was produced by early volcanic activity, and also from water-carrying comets impacting the earth. The water vapor remained in the gaseous form, since the early Earth was too hot for water to exist in liquid form. Liquid water oceans did not appear until approximately a billion years after the Earth formed.
Carbon dioxide was released by volcanoes on the early Earth and was one of the main constituents of its atmosphere. As the Earth aged, the amount of volcanic activity decreased and some organisms started to utilize carbon dioxide in photosynthesis. This led to a steady decline in carbon dioxide levels. Today's atmosphere consists of only 0.04 percent carbon dioxide.
Volcanoes on the early Earth also produced nitrogen, which became a major component of the atmosphere. Nitrogen is essential to creating building blocks of life, such as amino acids. Today, nitrogen is the biggest constituent of the Earth's atmosphere, accounting for approximately 78 percent of the gases.
There was no oxygen in the early atmosphere until simple organisms evolved the capability to carry out photosynthesis. During this process, sunlight and carbon dioxide are used in order to create energy, releasing oxygen as a by-product. Geochemical studies suggest that oxygen became a component of the atmosphere approximately 2 billion years after the Earth formed. A small proportion of the oxygen atoms bonded to create ozone -- a molecule consisting of three oxygen atoms -- in the upper atmosphere. Today, oxygen accounts for approximately 21 percent of the atmospheric gases and is essential to life. Simple molecular oxygen is used by most living creatures in order to create energy. The ozone layer plays an essential role by absorbing harmful ultraviolet light in today's atmosphere.