Carbon foams are hypothetical carbon allotropes that contain graphitelike (s p2 carbon) segments, connected by s p3 carbon atoms, resulting in porous structures. In this work the density-functional-based tight-binding method with periodic boundary conditions was employed to study the energetics, the stability, and the electronic properties of this unusual class of carbon systems. Concerning the most stable phases of carbon (graphite and diamond), foams show high structural stability at very low mass density. The electronic band structure and electronic density of states of foams indicate a similar size dependence as for carbon nanotubes. The calculated bulk moduli are in the range between those of graphite (5.5 GPa) and diamond (514 GPa). These structures may represent stable carbon modifications with s p2 -s p3 hybridization. The low density and high porosity make the carbon foams interesting as materials for hydrogen storage, for example.