Micro/nano-porous SiOC foams with narrow pore size distribution were fabricated by pyrolysis of polymeric gels prepared from mixtures of crosslinkable polysiloxane PSO and methyl-terminated polydimethylsiloxane PDMS. By simply changing the viscosity of the PDMS or its mass ratio in the mixed polymers, the pore sizes and porosities of the porous SiOC materials could be adjusted in the range from 10 nm to 3 μm, and 20% to 90%, respectively.