A better understanding of cell–cell and cell–niche interactions is crucial to comprehend the complexity of inflammatory or pathophysiological scenarios such as tissue damage during viral infections, the tumour microenvironment and neuroinflammation. Optical clearing and 3D volumetric imaging of large tissue pieces or whole organs is a rapidly developing methodology that holds great promise for the in-depth study of cells in their natural surroundings. These methods have mostly been applied to image structural components such as endothelial cells and neuronal architecture. Recent work now highlights the possibility of studying immune cells in detail within their respective immune niches. This Review summarizes recent developments in tissue clearing methods and 3D imaging, with a focus on the localization and quantification of immune cells. We first provide background to the optical challenges involved and their solutions before discussing published protocols for tissue clearing, the limitations of 3D imaging of immune cells and image analysis. Furthermore, we highlight possible applications for tissue clearing and propose future developments for the analysis of immune cells within homeostatic or inflammatory immune niches.