In Namibia’s Namib Sand Sea, dunes rise as high as 100 meters and stand about 2 kilometers apart. Their slopes and ridges record the winds that shaped them. Now, researchers have found that the sand itself holds another clue: the size of its grains can reveal how fast those winds blew.

That matters well beyond the deserts of Earth. Scientists have spotted wind-shaped dunes and ripples on Mars, Venus, Saturn’s moon Titan and even a comet. The shapes can show which way the wind blew and whether it kept blowing in the same direction. But working out wind speed has been harder. A new study from Stanford University offers a way to estimate it from the median grain size in a dune field—the size at the middle of the range of grains measured.

The team examined 30 years of wind records and sand measurements from 24 dune fields around the world. The sites varied in shape, size and location, from Coral Pink Sand Dunes State Park in Utah to Namibia’s ancient desert. For each field, the researchers worked out which wind speeds moved the most sand over time. They found that those winds were closely linked to grain size and were only a little faster than the minimum speed needed to move the sand along the ground.

The idea builds on a hypothesis proposed by University of Pennsylvania researchers in 2010: dunes form mainly in winds just above the threshold for moving sand. Stanford’s results give that idea strong support across all 24 Earth dune fields they studied. The researchers then tested data from a dune field on Mars and found a similar relationship, despite major differences between the planets in air pressure, gravity and the density of loose material.

Lead author Colin Marvin, who worked on the study as a Ph.D. student in the lab of Stanford professor Mathieu Lapôtre, described dunes as “a great recorder” of the exchange between a planet’s atmosphere and its surface. If grain size can serve as a wind speedometer, scientists may be able to read that record in places where direct wind measurements are impossible—and in rocks that have preserved old dunes long after the winds stopped.

The method could help researchers rebuild pictures of past climates on Earth and Mars and test models of how their atmospheres moved. Lapôtre said the approach works not only for modern dunes but also for sandstones dating back 3 billion years. That gives scientists a way to compare ancient landscapes with present-day ones, even as planetary conditions have changed over time.

The study, published in Proceedings of the National Academy of Sciences, suggests that dune formation follows a shared pattern wherever loose sand is available and strong winds are relatively rare. Marvin is already working on the next steps, Lapôtre said. As researchers apply the method to more ancient and planetary dunes, grain by grain, the landscape may offer a clearer account of the winds that once crossed it.