If learning a foreign language seems to get harder and harder with age, it isn't just your imagination. A new study by Boston-based researchers, including experimental psychologist Steven Pinker, finds that language-learning ability starts to decline after age 18, the BBC reports.

And if you want to sound like a native speaker, your chances are better if you started learning before the ripe old age of 10. Using the results of an online grammar test that was circulated on Facebook, researchers determined that children have the best capacity for learning complex grammar rules, while those of us who started learning a language in adulthood "are often saddled with an accent and conspicuous grammatical errors." Their findings were published in the journal Cognition, and they're in the process of developing similar tests for Spanish and Mandarin speakers.

The online test was taken by nearly 670,000 Facebook users of all ages from around the world—one of the largest linguistic studies ever conducted, according to Scientific American. Test takers were asked their age, how long they had been learning English, and the countries they've lived in for at least six months. The study found that people who learned a language by immersion were more fluent than those who learned in a classroom. Based on these test results and demographics, researchers developed models to predict how long it takes to achieve fluency in a language.

Researchers aren't sure what causes the drastic decline after age 18, but they believe it has something to do with the fact that the brain becomes less adaptable in adulthood.

However, that's no reason to sell your Rosetta Stone software just yet. Researchers say dedicated language learners can still become proficient—even fluent—well into adulthood. A study from 2014 revealed that learning a new language as an adult can help slow brain decline, and other studies point to the benefits of being bilingual, including a later onset of dementia. But the Boston researchers also found that it takes 30 years to fully master a language, so it's best to get started right away.

[h/t BBC]