Like a computer the brain works best when it is cool, but putting too great a strain on it can lead to overheating which reduces its ability to process information.
When the head begins to heat up, yawning acts as a natural "thermostat" by allowing cool air to rush in and bring the brain back down to a healthy temperature, research suggests.
A study of 160 volunteers in Arizona found that people yawned almost twice as much in winter, when their body temperature was higher than the air around them, than in summer.
There would be less benefit from yawning in summer because the air people breathed in would have been warmer than their bodies, Princeton University scientists said.
Dr Andrew Gallup, who led the research, said having an overheated brain could cause feelings of drowsiness, explaining why we also yawn when we are sleepy.
He said: "When you are warmer you are more likely to feel tired. At night when you are about to sleep your body temperature is at its highest point of the day."
The researchers studied how often a group of 80 people in Tuscon yawned in response to pictures of other people yawning during winter, and repeated the exercise with another group of 80 volunteers in summer.
In the winter, when outdoor temperatures averaged 21 degrees, 45 per cent of people responded to the images by yawning themselves.
But in summer, when conditions are much hotter than the average body temperature of 37 degrees, fewer than a quarter yawned. The effect was especially strong after participants had spend five minutes outside and their bodies had had a chance to sense the change in temperature, Dr Gallup said.
A previous study in rats showed that yawning was triggered by rapid increases in brain heat and was followed by a sudden drop in temperature, he added.