Writing
How long does it take to form a habit?
The popular number is wrong, the researched number is widely misquoted, and the spread around it matters more than the average.
Where 21 days came from
From a plastic surgeon. Maxwell Maltz published "Psycho-Cybernetics" in 1960, in which he observed that his patients seemed to take about 21 days to get used to their new appearance, and that amputees took roughly that long to stop sensing a phantom limb.
That is an anecdotal clinical observation about adjusting to an altered body. It is not a study of habit formation, it was never presented as one, and Maltz himself framed it as a minimum rather than a rule. Decades of self-help repetition sanded off the caveats and left a round number, which is exactly the kind of fact that spreads because it is convenient rather than because it is true.
What the actual research found
The study people usually mean is Lally and colleagues at University College London, published in the European Journal of Social Psychology in 2010. Participants chose an everyday eating, drinking or activity behaviour to repeat daily in a consistent context, and the researchers tracked how automatic it felt over 12 weeks.
The median time to reach a plateau of automaticity was 66 days. That is the number that gets quoted, generally as though it were the answer.
The far more useful finding is the range: roughly 18 to 254 days, depending on the person and the behaviour. The study was also modest in size — under a hundred participants, on simple behaviours, over a fixed window that some participants had not finished converging within. It is good evidence that habit formation is slow and variable. It is not a stopwatch.
Why the spread is the real finding
A median of 66 with a range of 18 to 254 tells you the average is nearly useless as a personal prediction. Drinking a glass of water after breakfast and going for a 40-minute run are not the same kind of task, and they did not converge on the same timescale.
Broadly, simpler behaviours in stable contexts automate faster. Complex, effortful behaviours take much longer, and some never become automatic at all — plenty of people who have exercised for twenty years still find starting each session an act of will. That is not failure. Automaticity was never the only thing that keeps a behaviour going.
The practical consequence: if you quit at day 21 because a book told you it should have clicked by then, you very likely quit while the process was working normally.
A better question than 'how long'
"How long until this is automatic" is hard to answer and, for most purposes, not the thing you need to know. "Is this doing anything for me" is answerable, on a shorter timescale, from your own data.
Twenty paired days of a habit and an outcome recorded together is enough to start looking at whether the two move together. That is around three weeks — the same span the myth promised automaticity in, spent answering a question that can actually be answered in it.
It also changes what a missed day means. If you are counting down to day 66, a gap feels like a reset. If you are accumulating paired observations, a missed day is one fewer data point and nothing else. This is why Crescendo's streaks count a day at 60% of its expected load and never let an in-progress today break a run: the run was never the point.