“We are what we repeatedly do,” Will Durant observed in summarizing Aristotle. “Could the young but realize how soon they will become mere walking bundles of habits, they would give more heed to their conduct while in the plastic state,” William James wrote. But how, exactly, do we rewire our habits once they have congealed into daily routines? We already know that it takes more than “willpower.”

When he became interested in how long it takes for us to form or change a habit, psychologist Jeremy Dean found himself bombarded with the same magic answer from popular psychology websites and advice columns: 21 days. And yet, strangely — or perhaps predictably, for the internet — this one-size-fits-all number was being applied to everything from starting a running regimen to keeping a diary, but wasn’t backed by any concrete data. In Making Habits, Breaking Habits: Why We Do Things, Why We Don’t, and How to Make Any Change Stick (public library) — which also gave us this fascinating read on the psychology of self-control — Dean, whose training is in research, explores the actual science of habits through the existing empirical evidence on habit-formation. He cites one influential study that gives a more concrete answer to the elusive question of how long it takes for a new habit to take root:

In a study carried out at University College London, 96 participants were asked to choose an everyday behavior that they wanted to turn into a habit. They all chose something they didn’t already do that could be repeated every day; many were health-related: people chose things like “eating a piece of fruit with lunch” and “running for 15 minutes after dinner.” Each of the 84 days of the study, they logged into a website and reported whether or not they’d carried out the behavior, as well as how automatic the behavior had felt.

This notion of acting without thinking — known in science as “automaticity” — turns out, perhaps unsurprisingly, to be a central driver of habits. And it helps illuminate the real question at the heart of this inquiry: How long did it actually take for people to form a habit? Dean writes:

The simple answer is that, on average, across the participants who provided enough data, it took 66 days until a habit was formed. As you might imagine, there was considerable variation in how long habits took to form depending on what people tried to do. People who resolved to drink a glass of water after breakfast were up to maximum automaticity after about 20 days, while those trying to eat a piece of fruit with lunch took at least twice as long to turn it into a habit. The exercise habit proved most tricky with “50 sit-ups after morning coffee,” still not a habit after 84 days for one participant. “Walking for 10 minutes after breakfast,” though, was turned into a habit after 50 days for another participant.

What’s more, when researchers plotted the results, they found a curved relationship between habit and automaticity — meaning that the earlier repetitions were most beneficial for establishing a habit, and gains gradually dwindled over time. Dean explains:

It’s like trying to run up a hill that starts out steep and gradually levels off. At the start you’re making great progress upwards, but the closer you get to the peak, the smaller the gains in altitude with each step.

Indeed, the slowing down of gains was especially pronounced among some participants, to whom habit-formation simply didn’t seem to come naturally — so much so, that the researchers were surprised by how slowly some habits seemed to form:

Although the study only covered 84 days, by extrapolating the curves, it turned out that some of the habits could have taken around 254 days to form — the better part of a year! What this research suggests is that 21 days to form a habit is probably right, as long as all you want to do is drink a glass of water after breakfast. Anything harder is likely to take longer to become a really strong habit, and, in the case of some activities, much longer.

While the finding may at first appear disheartening, it’s actually oddly assuring in reminding us that habit, like genius, is merely a matter of doggedness and “deliberate practice” — in fact, this brings us to the lesser-cited yet pivotal second half of Aristotle’s famous dictum: “Excellence … is not an act but a habit.”

Making Habits, Breaking Habits, which goes on to explore such fascinating facets as the difference between habit and intention, the key to getting off autopilot, and how to break out of habitual loops, is remarkably insightful and functionally helpful in its entirety. Complement it with the proto-treatise on the subject, William James’s famous meditation on habit, which includes his three rules for the successful formation of new habits.