In their darkest moments, people occasionally say “my best years are behind me.” The problem is, people say this whether they’re 69 or 29. Ezekiel Emanuel, a doctor and bioethicist, believes he only has 18 good years left: By 75, he wrote, “I will have made whatever contributions, important or not, I am going to make.”

At what age do we really peak? Is there ever a point where, intellectually, we’re as good as we’re going to get?

It depends on what you’re measuring, it turns out. In a study just out in Psychological Science, Joshua Hartshorne of the Massachusetts Institute of Technology and Laura Germine of Harvard take a look at the ages at which various types of cognitive performance crest. For the study, they gave 2,450 Americans of various ages and geographic provenances a set of 15 tasks, including math tests, picture completion, vocabulary quizzes, and even tapping sets of cubes in a certain order.

They found that most of the skills peaked in the subjects’ late teens and early 20s. Notably, though, four types of proficiencies didn’t fully ripen until people were in their 50s: vocabulary, math, general knowledge, and comprehension (a test that involved explaining why things are the way they are—for example, why we have a parole system):

Age of Peak Performance on Various Types of Tests

Central lines represent medians; whiskers represent 95% confidence intervals (Psychological Science)

Here’s another representation of how these skills vary over the lifespan. The green “family pictures” line was a test that involved being exposed to family pictures and later being asked to recall which characters were in the scene, where they were positioned, and what they were doing. The darker yellow “stories” line involved listening to two stories and then having to retell them:

Changes in Test Performance Over Lifespan

Psychological Science

Next, in a new data set consisting of 10,000 visitors to the site, Hartshorne confirmed that older participants performed better than younger ones on a vocabulary test, but younger ones outshined their older counterparts on a series of memory-related tests. And people right around the age of 47 did best at a test called “mind-in-eyes,” in which participants had to interpret people’s emotional states just by looking at their eyes:

Age of Peak Performance

Psychological Science

The results make a certain amount of intuitive sense. Memory-related tasks benefit from the sharpness of a younger brain, while tests that depend on a sizable knowledge base—the definition of martinet—might require a lifetime of lived experience. And maybe there’s just something about middle age that heightens emotional sensitivity.

The takeaway from the study is a happy one: There’s no single “smartest” age—people of different ages are best at different things. While in your 50s your memory might start failing you, your days of enjoying a brobdingnagian lexicon are still ahead.