This study focuses on the synthesis of a g-C3N4/Fe3O4 nanocomposite and optimization of PCP in degrading 2,4-D in water. The g-C3N4 and the g-C3N4/Fe3O4 were synthesized using a two-step direct calcination approach and co-precipitation respectively. The quality assessment of the synthesized nanocomposite was conducted through the utilization of XRD, DRS, FTIR, FE-SEM, EDS, elemental mapping, TEM and VSM analytical techniques. The quadratic model has a high F-value (152.27) and low P-value (0.0001), indicating its suitability for explaining the amplification relationship between response values. The optimum parameters for PCP to decompose 2,4-D were determined to be pH~6.5, catalyst dose~16.5 mg/L, reaction time~55.5 min, and initial 2,4-D concentration~52 mg/L (96.11% degradation efficacy). The data showed strong correlation with first-order kinetics (R2>0.95). The efficiency of the PCP is boosted by the existence of a catalyst and photolysis, which creates multiple pathways for 2,4-D breakdown. The PCP exhibited a capacity to diminish COD and TOC by 75% and 63%, respectively. The reaction time decreases with higher light intensity and 2,4-D removal is complete in 45 minutes at 60 mW/cm2. Methanol greatly affects the PCP's scavenging ability. In contrast, the impact of sodium azide was observed to be the least significant and the OH● is deemed as the principal ROS in the PCP. The results show that PO43- reduces efficiency to 72%. The PCP's ability to remove 2,4-D, COD, and TOC remained consistent even after the sixth cycle. The EE/O, 17.3 KW/h.m3.order was calculated. The intermediate products were 2,4-dichlorophenol, 2,6-dichlorophenol, 4,6-dichlororesorcinol, 2-chlorohydroquinone, and 2-chloro-1,4-benzoquinone.