There is no air in space because there is no gravity to condense the molecules of gases found there into air. On Earth, gravity holds nitrogen, oxygen and the other gases that compose the atmosphere together, but only to about 60 miles above the surface.
A few particles of dust and molecules of gases float in space. Scientists call this mixture interstellar medium. The particles and molecules in interstellar medium are so rare that many people think of space as a perfect vacuum. While it is closer to a perfect vacuum than anything man is able to create on Earth, it is not perfect. Interstellar medium is 99 percent gas, but the gas molecules are very far apart, and hydrogen is the most common gas in the mix. Interstellar dust particles are too small to see with the naked eye and are composed of silicates, iron, ice crystals and carbon.
The air at the surface of Earth has many molecules of gases in a small space. As the distance from the surface increases, the relative concentration of the gases decreases, meaning the air becomes thinner. At the 60-mile level, the concentration begins to change and the atmosphere is primarily lighter gases, such as hydrogen or helium, and closer to the composition of interstellar medium.