A facile and reproducible template free in situ precipitation method has been developed for the synthesis of Ag3PO4 nanoparticles on the surface of a g-C3N4 photocatalyst at room temperature. The g-C3N4–Ag3PO4 organic–inorganic hybrid nanocomposite photocatalysts were characterized by various techniques. TEM results show the in situ growth of finely distributed Ag3PO4 nanoparticles on the surface of the g-C3N4 sheet. The optimum photocatalytic activity of g-C3N4–Ag3PO4 at 25 wt% of g-C3N4 under visible light is almost 5 and 3.5 times higher than pure g-C3N4 and Ag3PO4 respectively. More attractively, the stability of Ag3PO4 was improved due to the in situ deposition of Ag3PO4 nanoparticles on the surface of the g-C3N4 sheet. The improved performance of the g-C3N4–Ag3PO4 hybrid nanocomposite photocatalysts under visible light irradiation was induced by a synergistic effect, including high charge separation efficiency of the photoinduced electron–hole pair, the smaller particle size, relatively high surface area and the energy band structure. Interestingly, the heterostructured g-C3N4–Ag3PO4 nanocomposite significantly reduces the use of the noble metal silver, thereby effectively reducing the cost of the Ag3PO4 based photocatalyst.