Electron energy-loss spectroscopy (EELS) is an analytical technique that measures the change in kinetic energy of electrons after they have interacted with a specimen. When carried out in a modern transmission electron microscope, EELS is capable of giving structural and chemical information about a solid, with a spatial resolution down to the atomic level in favourable cases. The energy resolution is typically 1 eV but can approach 0.1 eV if an electron-beam monochromator is used. This review provides an overview of EELS instrumentation and of the physics involved in the scattering of kilovolt electrons in solids. Features of the energy-loss spectrum are discussed, including plasmon peaks, inner-shell ionization edges and fine structure related to the electronic densities of states. Examples are given of the use of EELS for the measurement of local properties, including specimen thickness, mechanical and electronic properties (such as bandgap) and chemical composition. Factors that determine the spatial resolution of the analysis are outlined, including radiation damage to the specimen. Comparisons are made with related techniques, particularly x-ray absorption spectroscopy. (Some figures in this article are in colour only in the electronic version) This article was invited by Professor D Cockayne.