A facile construction of B and P doped carbon nitride as a potential photo-catalyst for splitting water to generate hydrogen or oxygen and BPA removal under visible light. B and P doping are confirmed by a series of characterizations. As the symmetrical π-conjugated rings of g-C3N4 could be destroyed by B and P doping to enhance the visible-light absorbance and n → π∗ electronic transition to provide a new pathway for the directional separation of photoexcited electrons to boost the photocatalytic activity. Significantly, the CN-BP catalyst demonstrates excellent H2 and O2 evolution rates of 4.0 mmolH2 h−1 g−1 and 0.3 mmolO2 h−1 g−1 under visible light, which is about ∼3.8 and 21.6 times higher than that of g-C3N4, respectively. Notably, without sacrificial agent, the CN-BP could remove BPA completely by oxidation to generate 30 μmol h−1g−1 H2. Both DFT calculations and characteristic results reveal that B and P doped carbon nitride reduce band gap energy, improve light harvesting and separation rate of electron-holes carriers for upgrading the photocatalytic activity.