Desert ants (Cataglyphis) are renowned for their ability to perform large-scale foraging excursions and then return to the nest by path integration. They do so by integrating courses steered and the distances travelled into a continually updated home vector. Whereas the angular orientation is based on skylight cues, how the ants gauge the distances travelled has remained largely unclear. Furthermore, almost all studies on path integration in Cataglyphis, as well as in spiders, rodents, and humans, have aimed at understanding how the animals compute homebound courses in the horizontal plane. Here, we investigate for the first time how an animal's odometer operates when a path integration task has to be accomplished that includes a vertical component. We trained Cataglyphis ants within arrays of uphill and downhill channels, and later tested them on flat terrain, or vice versa. In all these cases, the ants indicated homing distances that corresponded not to the distances actually travelled but to the ground distances; that is, to the sum of the horizontal projections of the uphill and downhill segments of the ants' paths.