What is the chemical formula of biogas?

Biogas from anaerobic digestion is normally composed of methane (CH4), carbon dioxide (CO2), and traces of ammonia (NH3), hydrogen sulfide (H2S). CH4 is often between 40 and 70%.