Soil microorganisms globally are thought to be sustained primarily by organic carbon sources. Certain bacteria also consume inorganic energy sources such as trace gases, but they are presumed to be rare community members, except within some oligotrophic soils. Here we combined metagenomic, biogeochemical and modelling approaches to determine how soil microbial communities meet energy and carbon needs. Analysis of 40 metagenomes and 757 derived genomes indicated that over 70% of soil bacterial taxa encode enzymes to consume inorganic energy sources. Bacteria from 19 phyla encoded enzymes to use the trace gases hydrogen and carbon monoxide as supplemental electron donors for aerobic respiration. In addition, we identified a fourth phylum (Gemmatimonadota) potentially capable of aerobic methanotrophy. Consistent with the metagenomic profiling, communities within soil profiles from diverse habitats rapidly oxidized hydrogen, carbon monoxide and to a lesser extent methane below atmospheric concentrations. Thermodynamic modelling indicated that the power generated by oxidation of these three gases is sufficient to meet the maintenance needs of the bacterial cells capable of consuming them. Diverse bacteria also encode enzymes to use trace gases as electron donors to support carbon fixation. Altogether, these findings indicate that trace gas oxidation confers a major selective advantage in soil ecosystems, where availability of preferred organic substrates limits microbial growth. The observation that inorganic energy sources may sustain most soil bacteria also has broad implications for understanding atmospheric chemistry and microbial biodiversity in a changing world.