A model for the timing of human sleep is presented. It is based on a sleep-regulating variable (S)--possibly, but not necessarily, associated with a neurochemical substance--which increases during wakefulness and decreases during sleep. Sleep onset is triggered when S approaches an upper threshold (H); awakening occurs when S reaches a lower threshold (L). The thresholds show a circadian rhythm controlled by a single circadian pacemaker. Time constants of the S process were derived from rates of change of electroencephalographic (EEG) power density during regular sleep and during recovery from sleep deprivation. The waveform of the circadian threshold fluctuations was derived from spontaneous wake-up times after partial sleep deprivation. The model allows computer simulations of the main phenomena of human sleep timing, such as 1) internal desynchronization in the absence of time cues, 2) sleep fragmentation during continuous bed rest, and 3) circadian phase dependence of sleep duration during isolation from time cues, recovery from sleep deprivation, and shift work. The model shows that the experimental data are consistent with the concept of a single circadian pacemaker in humans. It has implications for the understanding of sleep as a restorative process and its timing with respect to day and night.