A template induced method was developed to synthesize nanoporous graphitic carbon nitride (npg-CN) by directly heating Triton X-100-modified-melamine sulfate. The effects of the added amount of Triton X-100 and heating temperature on the formation of npg-CN were investigated. The npg-CN samples were characterized by XRD, FT-IR, and elemental analysis; nitrogen adsorption isotherms, SEM and TEM images; and UV-vis DRS and photoluminescence spectra. The results showed that the npg-CN samples possessed a laver-like layered structure with a high surface area (50-135 m 2 g À1 ). Meanwhile, compared to the bulk g-CN (synthesized by directly heating melamine), the npg-CN samples possessed stronger optical absorptions, narrower band gaps, and significantly reduced fluorescence intensity. The photocatalytic activity was investigated by degradation of Rhodamine B under visible light irradiation. As a result, the photodegradation rate of Rhodamine B dye on the npg-CN samples was greatly improved over that on bulk g-CN.