Strain and defects can significantly impact the performance of functional nanomaterials. This effect is well exemplified by energy storage systems, in which structural changes such as volume expansion and defect generation govern the phase transformations associated with charging and discharging. The rational design of next-generation storage materials therefore depends crucially on understanding the correlation between the structure of individual nanoparticles and their solute uptake and release. Here, we experimentally reconstruct the spatial distribution of hydride phases within individual palladium nanocrystals during hydrogen absorption, using a combination of electron spectroscopy, dark-field imaging, and electron diffraction in an environmental transmission electron microscope. We show that single-crystalline cubes and pyramids exhibit a uniform hydrogen distribution at equilibrium, whereas multiply twinned icosahedra exclude hydrogen from regions of high compressive strains. Our technique offers unprecedented insight into nanoscale phase transformations in reactive environments and can be extended to a variety of functional nanomaterials.