Migratory marine animals exploit resources in different oceanic regions at different life stages, but how they navigate to specific oceanic areas is poorly understood. A particular challenge is explaining how juvenile animals with no prior migratory experience are able to locate specific oceanic feeding habitats that are hundreds or thousands of kilometers from their natal sites. Although adults reproducing in the vicinity of favorable ocean currents can facilitate transport of their offspring to these habitats, variation in ocean circulation makes passive transport unreliable, and young animals probably take an active role in controlling their migratory trajectories. Here we experimentally demonstrate that juvenile Chinook salmon (Oncorhynchus tshawytscha) respond to magnetic fields like those at the latitudinal extremes of their ocean range by orienting in directions that would, in each case, lead toward their marine feeding grounds. We further show that fish use the combination of magnetic intensity and inclination angle to assess their geographic location. The “magnetic map” of salmon appears to be inherited, as the fish had no prior migratory experience. These results, paired with findings in sea turtles, imply that magnetic maps are phylogenetically widespread and likely explain the extraordinary navigational abilities evident in many long-distance underwater migrants.