The older you get the more difficult it is to learn to speak French like a Parisian. But no one knows exactly what the cutoff point is—at what age it becomes harder, for instance, to pick up noun-verb agreements in a new language. In one of the largest linguistics studies ever conducted—a viral internet survey that drew two thirds of a million respondents—researchers from three Boston-based universities showed children are proficient at learning a second language up until the age of 18, roughly 10 years later than earlier estimates. But the study also showed that it is best to start by age 10 if you want to achieve the grammatical fluency of a native speaker.

To parse this problem, the research team, which included psychologist Steven Pinker of Harvard University, collected data on a person’s current age, language proficiency and time studying English. The investigators calculated they needed more than half a million people to make a fair estimate of when the “critical period” for achieving the highest levels of grammatical fluency ends. So they turned to the world’s greatest experimental subject pool: the internet.

They created a short online grammar quiz called Which English? that tested noun–verb agreement, pronouns, prepositions and relative clauses, among other linguistic elements. From the responses, an algorithm predicted the tester’s native language and which dialect of English (that is, Canadian, Irish, Australian) they spoke. For example, some of the questions included phrases a Chicagoan would deem grammatically incorrect but a Manitoban would think is perfectly acceptable English.

The researchers got a huge response by providing respondents with “something that is intrinsically rewarding,” says Joshua Hartshorne, an assistant professor of psychology at Boston College, who led the study while he was a postdoc at the Massachusetts Institute of Technology. The small gift to the respondents was a guess about their background. According to Hartshorne: “If it correctly figures out that you are in fact a German-American, people are like, ‘Oh my god, science is awesome!’ And when it’s wrong, they’re like, ‘Ha ha, stupid robot.’ Either way, it’s entertaining and interesting and something that they can think about and talk about with their friends.”

Hartshorne’s tactic worked. At its peak, the quiz attracted 100,000 hits a day. It was shared 300,000 times on Facebook, made the front page of Reddit and became a trending topic on 4chan, where a thoughtful discussion ensued about how the algorithm could determine dialect from the grammar questions. The study brought in native speakers of 38 different languages, including 1 percent of Finland’s population.

Based on people’s grammar scores and information about their learning of English, the researchers developed models that predicted how long it takes to become fluent in a language and the best age to start learning. They concluded that the ability to learn a new language, at least grammatically, is strongest until the age of 18 after which there is a precipitous decline. To become completely fluent, however, learning should start before the age of 10.

There are three main ideas as to why language-learning ability declines at 18: social changes, interference from one’s primary language and continuing brain development. At 18, kids typically graduate high school and go on to start college or enter the work force full-time. Once they do, they may no longer have the time, opportunity or learning environment to study a second language like they did when they were younger. Alternatively, it is possible that after one masters a first language, its rules interfere with the ability to learn a second. Finally, changes in the brain that continue during the late teens and early 20s may somehow make learning harder.

This is not to say that we cannot learn a new language if we are over 20. There are numerous examples of people who pick up a language later in life, and our ability to learn new vocabulary appears to remain constant, but most of us will not be able to master grammar like a native speaker—or probably sound like one either. Being a written quiz, the study could not test for accent, but prior research places the critical period for speech sounds even earlier.

Although the study was conducted only in English, the researchers believe the findings will transfer to other languages, and they are currently developing similar tests for Spanish and Mandarin.

Perhaps even more important than when one learns a language is how. People who learned via immersion—living in an English-speaking country more than 90 percent of the time—were significantly more fluent than those who learned in a class. Hartshorne says that if you have the choice between starting language lessons earlier or learning through immersion later, “I'd learn in an immersion environment. Immersion has an enormous effect in our data—large even relative to fairly large differences in age.”

The enthusiasm for the study is not shared by everyone in the field. Elissa Newport, a professor of neurology at Georgetown University who specializes in language acquisition, remains a skeptic. “Most of the literature finds that learning the syntax and morphology of a language is done in about five years, not 30,” she says. “The claim that it takes 30 years to learn a language just doesn’t fit with any other findings.”

Newport says that although the premise of the study—seeking critical periods for learning a language—is warranted, she thinks the surprising results emerged because the measure the researchers used is flawed. “Testing 600,000 people doesn’t give you a dependable, reliable outcome” if you’re not asking the right questions, she says. Instead of creating a new test, Newport says she would have preferred the researchers use an existing assessment of language proficiency to ensure they are really gauging how well people know English.

Hartshorne is hoping to re-create the success of Which English? in a new online vocabulary test, but says he has struggled to create the same level of viral response because people are less willing to share their results if they perform poorly. “When you find out, ‘I'm in the 99th percentile of vocabulary,’ you’re like, ‘Okay, click, share.’ But you know 50 percent of people are below average. And they're going to be less likely to want to share that.”