Given the efficiency, stability and sustainability, the carbon-based materials have become one of promising bifunctional electrocatalysts to the electrochemical water splitting, involving hydrogen evolution reaction (HER) and oxygen evolution reaction (OER). However, there are still many challenges about the design and mechanism study of the carbon-based electrocatalysts. In this paper, we reported B, N co-doping carbon nanosheets which were synthesized via cationic intercalation stripping guar gum carbon aerogels pre-crosslinked by borate, B(OH) 4- . This facile strategy not only realizes the structure tailoring, but also concurrently improves the doping efficiency and the stability of the hetero atoms. Specifically, the cost-efficient carbon-based bifunctional catalyst (B5/GCS) shows an outstanding HER and OER performance displaying a remarkable activity both in acidic and alkaline media, low onset potentials for both HER (39.12 mV) and OER (1.38 V) in the same electrolyte (0.5 M H 2 SO 4 ). Notably, when employed as the bifunctional electrocatalysts with a two-electrode electrolyzer for water splitting, the B5/GCS generated a cell voltage of 1.45 V to attain 10 mA cm −2 in 0.5 M H 2 SO 4 . Furthermore, a series of experiments combining density functional theory calculations revealed that the observed superb water splitting activity could be attributed to a synergistic effect of N, B co-doping and the formation of fragmented nanosheets with topological defects, which collaboratively promotes the proton adsorption and catalytic kinetics.