Giraffes may be surprisingly good at simple math

Researchers found that some animals could “count” carrots in a test—and may have better numerical skills than dogs or horses.

Close-up of a giraffe's head and neck against a bright blue sky with fluffy clouds.
Scientists say the numerical skills displayed by zoo giraffes may help their wild counterparts survive.  
Frans Lanting, National Geographic Image Collection
ByCara Giaimo
Published July 9, 2026

Giraffes are the tallest of all land mammals, their heads poised nearly two stories above the savannah. What are they thinking, up in those lofty brains?

They might be doing their own version of math. In a new study in Scientific Reports, researchers show that at least some giraffes can combine quantities in their minds, a skill that not all animals have and that may be a building block for more advanced numerical abilities. 

The study was done with four giraffes at the Barcelona Zoo. Over hundreds of tries, two of these giraffes consistently demonstrated the ability to remember and combine quantities in a carrot-based math test. 

Although direct comparison is difficult because of varying study methods, it appears that giraffes are better at this than horses, dogs, or zebrafish, says Iker Loidi, a graduate student in clinical psychology and psychobiology at the University of Barcelona and the lead author of the new paper. Knowing their skill level can give us a peek into how giraffes navigate the world, says Loidi, and can help us "see how the mind has evolved using a wider view." 

Quantifying carrots

This test involved one of the giraffes’ favorite vegetables: carrots. Loidi stood at a table with one green container and two yellow containers as the giraffe watched. He opened a lid on each yellow container to reveal a small number of carrot pieces. Next he showed each giraffe the green container, which contained additional carrot pieces. He then covered the yellow containers so that the carrots were no longer visible, before adding extra carrots via a hole in the back of one yellow container. The giraffes had to figure out which yellow container had ended up with more food inside.

In a video of a giraffe named Nuru taking the test, the first yellow container has two carrot pieces, the second container has three, and the green container has two. Loidi then adds the two carrot sticks from the green container to the first yellow container. After a short pause, Nuru correctly chooses the first container, then chomps down on her reward of four total carrot sticks. 

In order to make the right decision, Nuru had to "manipulate those quantities mentally," holding each one in her mind, adding the relevant amounts together, and understanding that 2+2 is greater than 3, Loidi says. Because the giraffes most likely don't assign symbols to stand in for the quantities, the way that humans and some other animals can, "it's not real addition," Loidi clarifies. "It's more like the perceptive basis for addition"—possibly reflecting the same mental processes that we have built on to create more complex math.   

Loidi and his colleagues did multiple rounds of quantity combination testing with all four giraffes. Two, Nuru and a male named Njano, passed the tests with flying colors. The other two found a way to cheat—they were able to choose the right container, but only when it was also the last container the researcher touched. Researchers aren’t sure why some giraffes passed and others didn’t, but the different giraffes may naturally have varying numerical abilities, or some might have learned different skills in the zoo, says Loidi.

The team did similar tests to check whether the giraffes could dissociate quantities, which is similar to subtraction. They also tried them on tasks that involved both combination and dissociation. The giraffes did not succeed at these, probably because subtraction-like operations are “more complex” than addition-like ones, Loidi says.

Ahead of the pack

Numerical thinking was once considered to be unique to humans. But over the past few decades, researchers have found that many different animals can understand and work with quantities. Honeybees count the number of landmarks they pass, for example, while wolves can judge whether their packs are large enough to hunt large mammals.

Loidi is part of a team that studies cognition in ungulates, a group that comprises all hoofed mammals, from antelope to zebras. The team previously tested how well ungulates can discriminate between different quantities of the same object—whether they will reliably choose a tray with six snacks on it over one with four, for instance. In this study, giraffes outperformed eight other species, including llamas, bison, and rhinoceroses. 

Another experiment had shown that giraffes can also take probabilities into account when deciding what salad mixes to nibble on—they choose the ones with proportionally more carrots, which they love.

"We could see that they were quite good with numbers," Loidi says, which inspired them to give the giraffes this latest test.

The long neck of progress

Because other species have demonstrated similar abilities, "showing that giraffes can perform this kind of quantity manipulation is not, by itself, a revolutionary discovery," says Tyrone Lucon Xiccato, a zoologist at the University of Ferrara in Italy who has studied numerical cognition in several fish species. 

But each new test "helps us build a more complete picture of how cognitive abilities evolved across animals," Xiccato says. It also moves us a step closer to answering bigger questions, such as how an animal's numerical skills relate to its ecology and lifestyle. 

While we can't know for sure why giraffes have these abilities, Loidi says they may use them to determine which parts of the savannah have more acacia trees, to avoid predators, or to make decisions within their complex social groups, which often split and recombine. 

As we work to share the planet with giraffes and other creatures, their skills also serve as an important reminder: "These animals have a lot of things to show us," Loidi says. "They are cognitive beings. We are not the only intelligent animals."