N-nitrosodimethylamine (NDMA) as the most frequently detected disinfection by-product has aroused widespread concern due to its unusually high carcinogenicity, however, there is still limited understanding of its formation mechanisms. In this study, the formation mechanisms of NDMA from some typical hydrazines and hydrazones with high NDMA conversion yields (60%∼90%) during ozonation, i.e., unsymmetrical dimethylhydrazine (UDMH), 1-formyl-2,2-dimethylhydrazine (FDMH), formaldehyde dimethylhydrazone (FDH) and acetone dimethylhydrazone (ADMH), were investigated by using DFT method with the M05 functional. A new NDMA formation mechanism from hydrazines during ozonation was proposed, in which the initial step is hydrogen abstraction rather than previously reported oxygen addition. For hydrazones, the C atom of the -N = C moiety in hydrazones is preferred to be attacked by ozone to generate N,N-dimethylaminonitrene (DMAN), which is an important intermediate in NDMA formation during ozonation. Moreover, the reactivity order of the following H atoms in hydrogen/hydride ion abstraction (HA) by ozone is -NH2 > -N(CH3)2 > -CO-NH ∼ =C(CH3)2 > =CH-. Additionally, formation pathways of some experimentally detected compounds, i.e., HOOOH, HOOH and HCOH, in the ozonation of hydrazine were elucidated in this study. The results are expected to expand our understanding of NDMA formation mechanisms and ozone reaction characteristics.