The use of photocatalysis in conjunction with biomass presents an innovative and promising way to increase the sustainability of chemical processes. In this work, a g- C3N4@AgFe2O4 heterojunction nanocomposite was prepared by a facile sonication method and subsequently modified with sulfonic acid groups to form a new acidic photocatalyst with enhanced photocatalytic activity. The structure, surface composition, morphology, and optical absorption features of the prepared photocatalyst were studied using the state-of-the- art characterization techniques. Visible-light-driven photocatalytic dehydration of biomass- derived carbohydrates to 5-hydroxymethylfurfural (HMF), as a versatile platform compound, was employed to assess its catalytic property. Compared with traditional homogeneous and heterogeneous acid catalysts, the prepared photocatalyst reveled superior or equal catalytic activity in the production of HMF from fructose only at a low temperature (90 °C, 91% yield). The photocatalyst was easily recovered and remained active in recycle runs, approving its good stability. Furthermore, the developed protocol was found to be capable of converting other feedstocks, such as glucose, sucrose, and maltose into HMF with respectable yields. Interestingly, this work represents the first example of utilizing a g-C3N4@AgFe2O4 nanocomposite as a photocatalyst.