Context. PLAnetary Transits and Oscillations of stars (PLATO) is the ESA M3 space mission dedicated to detect and characterise transiting exoplanets including information from the asteroseismic properties of their stellar hosts. The uninterrupted and high-precision photometry provided by space-borne instruments such as PLATO require long preparatory phases. An exhaustive list of tests are paramount to design a mission that meets the performance requirements and, as such, simulations are an indispensable tool in the mission preparation. Aims. To accommodate PLATO’s need of versatile simulations prior to mission launch that at the same time describe innovative yet complex multi-telescope design accurately, in this work we present the end-to-end PLATO simulator specifically developed for that purpose, namely PlatoSim. We show, step-by-step, the algorithms embedded into the software architecture of PlatoSim that allow the user to simulate photometric time series of charge-coupled device (CCD) images and light curves in accordance to the expected observations of PLATO. Methods. In the context of the PLATO payload, a general formalism of modelling, end-to-end, incoming photons from the sky to the final measurement in digital units is discussed. According to the light path through the instrument, we present an overview of the stellar field and sky background, the short- and long-term barycentric pixel displacement of the stellar sources, the cameras and their optics, the modelling of the CCDs and their electronics, and all main random and systematic noise sources. Results. We show the strong predictive power of PlatoSim through its diverse applicability and contribution to numerous working groups within the PLATO mission consortium. This involves the ongoing mechanical integration and alignment, performance studies of the payload, the pipeline development, and assessments of the scientific goals. Conclusions. PlatoSim is a state-of-the-art simulator that is able to produce the expected photometric observations of PLATO to a high level of accuracy. We demonstrate that PlatoSim is a key software tool for the PLATO mission in the preparatory phases until mission launch and prospectively beyond.