We have successfully synthesized boron-doped g-C3N4 nanosheets (B-CN) and its nanocomposites with nanocrystalline anatase TiO2 (T/B-CN). The as-prepared T/B-CN nanocomposites with the proper amounts of boron and TiO2 exhibit rather high cocatalyst-free photoactivities for producing H2 from CH3OH solution (∼29× higher) and CH4 from CO2-containing water (∼16× higher) under visible-light irradiation, compared to those of bare g-C3N4. This is attributed to the greatly enhanced photogenerated charge separation after doping boron and subsequent coupling with TiO2, mainly based on the measurements of atmosphere-controlled steady-state surface photovoltage spectra, transient-state surface photovoltage responses, photoluminescence spectra, and fluorescence spectra related to the produced hydroxyl radical amount. It is suggested for the first time that the great charge separation enhancement results from the B-induced surface states near the valence band top to trap holes and the formed heterojunctions to transfer electrons from B-CN to TiO2. Moreover, the created surface states are also responsible for the visible-light extension from 450 nm of g-C3N4 to 500 nm of B-CN (T/B-CN) for solar fuel production. Interestingly, the obtained 6T/6B-CN exhibits much larger quantum efficiencies, which are 3.08% for hydrogen evolution and 1.68% for CH4 production at λ = 420 nm, respectively, with 5.1× and 7.6× enhancement as compared to CN, even superior to other works. This work will provide feasible routes to synthesize g-C3N4-based nanophotocatalysts for efficient solar fuel production.