Intrinsically disordered proteins (IDPs) are highly abundant in nature and play vital roles in various biological processes. Understanding their biological functions requires extracting their exact conformations and dynamics, which remains a technical challenge, especially in cells, due to the exceptional spatiotemporal heterogeneity of IDPs. Here we develop an experimental approach using site-specific fluorescent labeling of IDPs in mammalian cells paired with highly time-resolved fluorescence microscopy. We used this tool to study the sub-resolution permeability barrier of nuclear pore complexes (NPC), which is located within a small cavity of ~50 nm in diameter and comprised of many phenylalanine-glycine-rich IDPs, known as FG-nucleoporins (FG-Nups). Single-cell measurements of the distance distribution of FG-Nup98 segments combined with coarse-grained modeling allowed us to map the uncharted molecular environment inside the nanosized transport channel. We determined that the channel provides—in the terminology of Flory polymer theory—a "good solvent" environment. This enables the FG domain to adopt more expanded conformations in situ and thus facilitate nuclear transport. In contrast, comparative in vitro fluorescence measurements of the condensed and aqueous solution FG phases revealed a different behavior, underlining the need to visualize the permeability barrier in situ to reconcile different transport models and understand the molecular basis for nuclear transport. With more than 30% of the proteome being formed from IDPs, our combination of small-molecule-labeling-enabled fluorescence microscopy and molecular simulation opens a window into resolving disorder–function relationships of IDPs in cells.