Herein we demonstrate a facile template-free sonochemical strategy to synthesize mesoporous g-C3N4 with a high surface area and enhanced photocatalytic activity. The TEM and nitrogen adsorption–desorption studies confirm mesoporous structure in g-C3N4 body. The photocatalytic activity of mesoporous g-C3N4 is almost 5.5 times higher than that of bulk g-C3N4 under visible-light irradiation. The high photocatalytic performance of the mesoporous g-C3N4 was attributed to the much higher specific surface area, efficient adsorption ability and the unique interfacial mesoporous structure which can favour the absorption of light and separation of photoinduced electron–hole pairs more effectively. A possible photocatalytic mechanism was discussed by the radicals and holes trapping experiments. Interestingly, the synthesized mesoporous g-C3N4 possesses high reusability. Hence the mesoporous g-C3N4 can be a promising photocatalytic material for practical applications in water splitting as well as environmental remediation.