Spatial cognitive abilities allow individuals to remember the location of resources such as food patches, predator hide-outs, or shelters. Animals typically incorporate learned spatial information or use external environmental cues to navigate their surroundings. A spectacular example of how some fishes move is through aerial jumping. For instance, fish that are trapped within isolated pools, cut off from the main body of water during dry periods, may jump over obstacles and direct their jumps to return to safe locations. However, what information such re-orientation behavior during jumping is based on remains enigmatic. Here we combine a lab and field experiment to test if guppies (Poecilia reticulata) incorporate learned spatial information and external environmental cues (visual and auditory) to determine where to jump. In a spatial memory assay we found that guppies were more likely to jump towards deeper areas, hence incorporating past spatial information to jump to safety. In a matched versus mismatched spatial cue experiment in the field, we found that animals only showed directed jumping when visual and auditory cues matched. We show that in unfamiliar entrapments guppies direct their jumps by combining visual and auditory cues, whereas in familiar entrapments they use a cognitive map. We hence conclude that jumping behavior is a goal-directed behavior, guided by different sources of information and involving important spatial cognitive skills.