Air at sea level contains about 79 percent nitrogen and 21 percent oxygen. Very little carbon dioxide is present — only about 0.04 percent. As the body needs to take in oxygen and exhale carbon dioxide, however, exhaled air has a different composition.
The lungs take oxygen into the body from the air, so the exhaled air necessarily contains less oxygen than inspired air, at about 16 percent.
The concentration of nitrogen remains the same when the air is breathed out, because the body does not need to extract any nitrogen from the air.
Carbon dioxide is a waste product, so the body exhales it in order to get rid of it. Compared to the low levels of about 0.04 percent in inspired air, exhaled air contains a hundred times more CO2, at 4 percent content.