Are you a night owl or a morning person?

If you’re among the hundreds of millions of people learning a foreign language, being an insomniac could end up working in your favor: If you regularly practice the language you are learning at night, just before you go to sleep, it appears that you’re more likely to remember it.

Sleep has been known to have a positive impact on learning. A 2016 study investigated the effect that repeated practice and sleep have on the long-term retention of information, particularly foreign-language vocabulary. Over the course of two sessions done 12 hours apart, 40 participants practiced foreign-language vocabulary. Half of them learned in the morning and reviewed in the evening of the same day, while the other half learned in the evening, slept on it, and then reviewed that lesson the next morning. One week later (and again six months later), the researchers assessed the participants’ retention. They discovered that sleeping in between lessons led to much better long-term retention.

This finding echoes the results of a recent analysis our team at Duolingo conducted on the learning habits of tens of thousands of language learners. However, we found that practicing before bed time isn’t the only trick: What’s key is making language learning a daily habit and sticking to it—consistently. Here’s the data that supports it.

The analysis

First, we analyzed Duolingo users’ behavior to identify 14 groups based on their activity level at different times of day. (Activity level was measured by the number of Duolingo lessons each user completed during a given hour of the day on weekdays and weekends.) The following heat map illustrates the 14 usage groups. Red indicates a lot of activity, while blue indicates inactivity (and yellows or greens indicate moderate activity):

Time and length of Duolingo use Image: Duolingo

Each group has its own distinct preferences for when to spend time learning throughout the week. The “bed time” group, for example, is most active between 10pm and midnight on both weekdays (left) and weekends (right), as indicated by the dark red cells during those hours. Compare that with the “9-to-5” group, who uses Duolingo mostly during the working hours of 10am to 6pm on weekdays (left), but not much on weekends (right). These behavioral groups were all discovered automatically by a clustering algorithm, and then we gave names to each group based on the results.

Next, we analyzed Duolingo users’ performance using an additive factor model, which can estimate each user’s language ability while controlling for the inherent difficulty of each exercise (due to vocabulary, grammar, or other factors). We can use this model to assess and rank each Duolingo learner according to their proficiency level.

The best time of day to learn a new language Image: Atlas Charts

When comparing Duolingo users’ proficiency across different groups, we found that those who practiced consistently just before bed time ranked higher than 52.9% of all users on average. This was the highest-performing group in our analysis.

On the other hand, users who practiced arbitrarily (without any regular routine) were the lowest-performing group, only ranking higher than 47.8% of all users on average. After the “arbitrary” group, those who practiced only on weekdays or weeknights (but didn’t keep it up over the weekend) showed the worst performance.

The best way to learn a language—and remember it

These results suggest a couple of things. Yes, those who study just before sleeping tend to perform better than other groups. But the time of day isn’t the only thing: Equally important is the fact that these language learners consistently studied daily before bed. Users in the “bed time” group made language practice a daily habit on weekdays and weekends alike. This wasn’t the case for several of the other lower-performing groups, such as the “weeknights,” “weekends,” or the “9-to-5” group that didn’t keep studying over the weekend.

Developing a regular daily habit is advantageous if you’re trying lead a healthier lifestyle, and language learning is no different. When people set aside focused time to learn and practice a skill, they appear to learn more than those who are less consistent—and perhaps just before bed turns out to be particularly good time to set aside, because you’re less likely to be interrupted by your workmate, laundry, or urge to sleep in.

While our analysis focused on users’ activity on Duolingo, language learning can take place in many forms. To go even further in making your practice a daily habit, try turning on French subtitles next time you’re watching your favorite TV show, or start listening to podcasts in Spanish on your daily commute. There are many ways to commit to making language learning part of your routine and, taken together, they can help you reach the level of proficiency you’re aiming for.