Aniline-related structures are common in anthropogenic chemicals, such as pharmaceuticals and pesticides. Compared with the widely studied phenolic compounds, anilines have received far less assessment of their disinfection byproduct (DBP) formation potential, even though anilines and phenols likely exhibit similar reactivities on their respective aromatic rings. In this study, a suite of 19 aniline compounds with varying N- and ring-substitutions were evaluated for their formation potentials of haloacetonitriles and trihalomethanes under free chlorination and free bromination conditions. Eight of the aniline compounds formed dichloroacetonitrile at yields above 0.50%; the highest yields were observed for 4-nitroaniline, 3-chloroaniline, and 4-(methylsulfonyl)aniline (1.6-2.3%). Free bromination generally resulted in greater haloacetonitrile yields with the highest yield observed for 2-ethylaniline (6.5%). The trihalomethane yields of anilines correlated with their haloacetonitrile yields. Product analysis of aniline chlorination by liquid chromatography-high-resolution mass spectrometry revealed several large-molecule DBPs, including chloroanilines, (chloro)hydroxyanilines, (chloro)benzoquinone imines, and ring-cleavage products. The product time profiles suggested that the reaction pathways include initial ring chlorination and hydroxylation, followed by the formation of benzoquinone imines that eventually led to ring cleavage. This work revealed the potential of aniline-related moieties in micropollutants as potent precursors to haloacetonitriles and other emerging large-molecule DBPs with the expected toxicity.