Ghost imaging is a novel technique that produces the image of an object by correlating the intensity of two light beams, neither of which independently carries information about the shape of the object. Ghost imaging has opened up new perspectives to obtain highly resolved images, even in the presence of noise and turbulence. Here, by exploiting the duality between light propagation in space and time, we demonstrate the temporal analogue of ghost imaging. We use a conventional fast detector that does not see the temporal ‘object’ to be characterized and a slow integrating ‘bucket’ detector that does see the object but without resolving its temporal structure. Our experiments achieve temporal resolution at the picosecond level and are insensitive to the temporal distortion that may occur after the object. The approach is scalable, can be integrated on-chip, and offers great promise for dynamic imaging of ultrafast waveforms.