Single-photon sources have recently been demonstrated using a variety of devices, including molecules, mesoscopic quantum wells, colour centres, trapped ions and semiconductor quantum dots. Compared with a Poisson-distributed source of the same intensity, these sources rarely emit two or more photons in the same pulse. Numerous applications for single-photon sources have been proposed in the field of quantum information, but most--including linear-optical quantum computation--also require consecutive photons to have identical wave packets. For a source based on a single quantum emitter, the emitter must therefore be excited in a rapid or deterministic way, and interact little with its surrounding environment. Here we test the indistinguishability of photons emitted by a semiconductor quantum dot in a microcavity through a Hong-Ou-Mandel-type two-photon interference experiment. We find that consecutive photons are largely indistinguishable, with a mean wave-packet overlap as large as 0.81, making this source useful in a variety of experiments in quantum optics and quantum information.