Liquid and solid state NMR studies of the nitration of toluene with a mixture of nitric acid and acetic anhydride have been performed in homogeneous solution and in a heterogeneous system using zeolite beta (small and large crystalline Al-beta with Si/Al = 13 and pure silicon beta), mordenite (Si/Al = 74 and 5) and ZSM-5 (Si/Al = 20) as catalysts. Acetyl nitrate proved to be the reactive species, although it decomposed slowly to tetranitromethane which was not active in the nitration. No NMR evidence for the presence of isolated nitronium ions, often thought to be the nitrating species, was found in the liquid phase. In the absence of acetic anhydride, nitric acid interacted strongly with the framework aluminium of the zeolite leading to a complex of one nitrate per aluminium. In contrast to free nitric acid, this species did not seem to take part in the nitration of toluene. Introduction of acetic anhydride converted the strongly bonded nitrate to the more reactive acetyl nitrate and acetic acid which were coordinated to the framework aluminium of the zeolite. Heterogeneous zeolite-catalysed nitration of toluene by acetyl nitrate improved the para- to ortho-nitrotoluene ratio compared to the homogeneous liquid phase nitration. The best para-selectivity was obtained with Al-beta and to a lesser extent with dealuminated mordenite, suggesting that the selectivity may be related to the presence of flexible lattice aluminium in these large pore zeolites.