This paper describes an algorithm for the simulation of occupant presence, to be later used as an input for future occupant behaviour models within building simulation tools. By considering occupant presence as an inhomogeneous Markov chain interrupted by occasional periods of long absence, the model generates a time series of the state of presence (absent or present) of each occupant of a zone, for each zone of any number of buildings. Tested on occupancy data from private offices, the model has proven its capacity to realistically reproduce key properties of occupant presence such as times of arrival and departure, periods of intermediate absence and presence as well as periods of long absence from the zone. This model (due to related metabolic heat gains), and associated behavioural models which use occupants' presence as an input, have direct consequences for building energy consumption. (c) 2007 Elsevier B.V. All rights reserved.