Monolithic carbon foams with hierarchical porosity were prepared from polyurethane templates and resol precursors. Mesoporosity was achieved through the use of soft templating with surfactant Pluronic F127, and macroporosity from the polyurethane foams was retained. Conditions to obtain high porosity materials were optimized. The best materials have high specific surface areas (380 and 582 m2 g–1, respectively) and high electrical conductivity, which make them good candidates for supports in sensors. These materials showed an almost linear dependence between the potential and the pH of aqueous solutions.