Porous carbons that are three-dimensionally periodic on the scale of optical wavelengths were made by a synthesis route resembling the geological formation of natural opal. Porous silica opal crystals were sintered to form an intersphere interface through which the silica was removed after infiltration with carbon or a carbon precursor. The resulting porous carbons had different structures depending on synthesis conditions. Both diamond and glassy carbon inverse opals resulted from volume filling. Graphite inverse opals, comprising 40-angstrom-thick layers of graphite sheets tiled on spherical surfaces, were produced by surface templating. The carbon inverse opals provide examples of both dielectric and metallic optical photonic crystals. They strongly diffract light and may provide a route toward photonic band-gap materials.