HOCl and UV activated HOCl (UV/HOCl) have been applied for water disinfection and abatement of organic contaminants. However, the production of toxic byproducts in the HOCl and UV/HOCl treatment should be scrutinized. This contribution comparatively investigated the elimination of 4-nitrophenol and the generation of chlorinated byproducts in HOCl and UV/HOCl treatment processes. 61.4% of 4-nitrophenol was removed by UV/HOCl in 5 min with HOCl dose of 60 μM, significantly higher than that by UV (3.3%) or HOCl alone (32.0%). Radical quenching test showed that HO• and Cl• played important roles in UV/HOCl process. 2-Chloro-4-nitrophenol and 2,6-dichloro-4-nitrophenol were generated consecutively in HOCl process; but their formation was less in the UV/HOCl process. Trichloronitromethane (TCNM) was only found in the UV/HOCl process, and its production increased with increasing HOCl dosage. Besides chlorinated products hydroxylated and dinitrated products were also identified in the UV/HOCl process. Transformation pathways involving electrophilic substitution, hydroxylation, and nitration were proposed for 4-nitrophenol transformation in the UV/HOCl process. Wastewater matrix could significantly promote the transformation of 4-nitrophenol to 2-chloro-4-nitrophenol in UV/HOCl process. Results of this study are helpful to advance the understanding of the transformation of nitrophenolic compounds and assess the formation potential of chlorinated byproducts in HOCl and UV/HOCl disinfection processes.