Single-molecule localization microscopy is a powerful tool for visualizing subcellular structures, interactions and protein functions in biological research. However, inhomogeneous refractive indices inside cells and tissues distort the fluorescent signal emitted from single-molecule probes, which rapidly degrades resolution with increasing depth. We propose a method that enables the construction of an in situ 3D response of single emitters directly from single-molecule blinking datasets, and therefore allows their locations to be pinpointed with precision that achieves the Cramér-Rao lower bound and uncompromised fidelity. We demonstrate this method, named in situ PSF retrieval (INSPR), across a range of cellular and tissue architectures, from mitochondrial networks and nuclear pores in mammalian cells to amyloid-β plaques and dendrites in brain tissues and elastic fibers in developing cartilage of mice. This advancement expands the routine applicability of super-resolution microscopy from selected cellular targets near coverslips to intra- and extracellular targets deep inside tissues.