During metazoan development, immune surveillance and cancer dissemination, cells migrate in complex three-dimensional microenvironments1-3. These spaces are crowded by cells and extracellular matrix, generating mazes with differently sized gaps that are typically smaller than the diameter of the migrating cell4,5. Most mesenchymal and epithelial cells and some-but not all-cancer cells actively generate their migratory path using pericellular tissue proteolysis6. By contrast, amoeboid cells such as leukocytes use non-destructive strategies of locomotion7, raising the question how these extremely fast cells navigate through dense tissues. Here we reveal that leukocytes sample their immediate vicinity for large pore sizes, and are thereby able to choose the path of least resistance. This allows them to circumnavigate local obstacles while effectively following global directional cues such as chemotactic gradients. Pore-size discrimination is facilitated by frontward positioning of the nucleus, which enables the cells to use their bulkiest compartment as a mechanical gauge. Once the nucleus and the closely associated microtubule organizing centre pass the largest pore, cytoplasmic protrusions still lingering in smaller pores are retracted. These retractions are coordinated by dynamic microtubules; when microtubules are disrupted, migrating cells lose coherence and frequently fragment into migratory cytoplasmic pieces. As nuclear positioning in front of the microtubule organizing centre is a typical feature of amoeboid migration, our findings link the fundamental organization of cellular polarity to the strategy of locomotion.