Two Giraffes Did Math in the Dark
At Barcelona Zoo, two giraffes picked the container holding more carrots after food was secretly added to one of two hidden piles, and they never once saw the final total. Iker Loidi and Jordi Galbany, researchers at the University of Barcelona, tested four giraffes and found that two of them tracked a quantity they couldn’t see, updated it after a change they also couldn’t see, and still chose correctly. To pull that off, a giraffe had to hold a number in memory, add to it mentally, and act on a total it never laid eyes on.
Yellow Boxes, Green Clue, No Peeking
Loidi and Galbany describe the setup in a paper titled “Assessing quantity combination and dissociation in giraffes,” published in Scientific Reports on June 26, 2026. It plays out like a shell game, scaled up for an animal that stands several times taller than the researcher running it.
Each giraffe watched two yellow containers get loaded with different amounts of chopped carrot, then watched both lids close. A third container, this one green, showed how much food was being added to one of the yellow containers, without ever revealing what that container now held. Only then did the giraffe get to choose, with no view of the combined result.
That blackout step is the whole point. If the animals could see the final amount, they’d just be comparing what sat in front of them, which is perception, not arithmetic. Because the yellow containers stayed shut the whole time, a correct choice meant the giraffe was holding the starting quantities in its head, updating one after the hidden change, and comparing two totals that existed only in memory.
Why Bother Adding in the Dark
The same four giraffes were also tested on subtraction, where the green container started empty and collected whatever was taken out of a yellow one, and on sequential tasks that combined both moves: take from one pile, add to the other. None of the four solved either version. Addition was the only operation that worked, and it worked for two animals out of four.
Loidi and Galbany note that this split mirrors what shows up in people: subtraction is consistently the harder operation, engaging brain regions tied to complex, controlled processing that plain addition doesn’t call on. As a hypothesis, not a settled finding, they also offer a reason giraffes might carry this skill at all. Acacia trees are scattered across the savanna, not clustered where an animal can survey its whole food supply in one glance. Estimating which patch holds more, without ever getting a full count, is close to the exact problem the carrot test poses.
Arithmetic Wasn’t Supposed to Live Here
The working assumption in animal cognition research has long been that arithmetic-like reasoning belongs to primates and a short list of famously sharp birds: chimpanzees, corvids, parrots. Giraffes are ungulates, hoofed mammals grouped with hippos, camels, and deer, a lineage with no particular reputation for numbers. This result is described as the first demonstration of arithmetic-type ability in a non-domestic ungulate, landing outside every group this skill was supposed to belong to.
The authors frame it as evidence for convergent evolution: the ability doesn’t need a shared clever ancestor. A savanna browser and a tree-dwelling primate can arrive at the same mental trick on entirely separate paths, each pushed there by its own way of finding food. If that holds up, the old line that complex cognition is a human and primate specialty doesn’t survive contact with a giraffe doing subtraction homework and failing it exactly the way we do.
What Nobody Knows Yet
Two of the four giraffes solved the addition task and two didn’t, and the study doesn’t explain the split. Loidi points only to individual variation in numerical problem-solving, the same kind of spread seen among human test-takers, without saying what separates a giraffe that cracks the test from one that doesn’t.
It’s also unclear whether this ability reaches past small quantities of chopped carrot in a zoo enclosure, and whether failing subtraction and the combined tasks marks a real ceiling on what a giraffe can hold in mind at once, or just a quirk of how the test was built. The researchers are careful to say these four giraffes show a cognitive foundation that could support more complex arithmetic, not that they already have it. Which means the honest answer, for now, is that we taught a giraffe to do our math homework and it only turned in half of it.