Solid–liquid interfaces are important in a range of chemical, physical and biological processes, but are often not fully understood owing to the lack of high-resolution characterization methods that are compatible with both solid and liquid components5. For example, the related processes of dendritic deposition of lithium metal and the formation of solid–electrolyte interphase layers are known to be key determinants of battery safety and performance in high-energy-density lithium-metal batteries. But exactly what is involved in these two processes, which occur at a solid–liquid interface, has long been debated because of the challenges of observing such interfaces directly. Here we adapt a technique that has enabled cryo-transmission electron microscopy (cryo-TEM) of hydrated specimens in biology—immobilization of liquids by rapid freezing, that is, vitrification. By vitrifying the liquid electrolyte we preserve it and the structures at solid–liquid interfaces in lithium-metal batteries in their native state, and thus enable structural and chemical mapping of these interfaces by cryo-scanning transmission electron microscopy (cryo-STEM). We identify two dendrite types coexisting on the lithium anode, each with distinct structure and composition. One family of dendrites has an extended solid–electrolyte interphase layer, whereas the other unexpectedly consists of lithium hydride instead of lithium metal and may contribute disproportionately to loss of battery capacity. The insights into the formation of lithium dendrites that our work provides demonstrate the potential of cryogenic electron microscopy for probing nanoscale processes at intact solid–liquid interfaces in functional devices such as rechargeable batteries.