Rapid variations in cortical state during wakefulness have a strong influence on neural and behavioural responses and are tightly coupled to changes in pupil size across species. However, the physiological processes linking cortical state and pupil variations are largely unknown. Here we demonstrate that these rapid variations, during both quiet waking and locomotion, are highly correlated with fluctuations in the activity of corticopetal noradrenergic and cholinergic projections. Rapid dilations of the pupil are tightly associated with phasic activity in noradrenergic axons, whereas longer-lasting dilations of the pupil, such as during locomotion, are accompanied by sustained activity in cholinergic axons. Thus, the pupil can be used to sensitively track the activity in multiple neuromodulatory transmitter systems as they control the state of the waking brain.