Most of us have heard that it takes about 21 days to form a habit (or possibly 28 or 30). According the London Global University, the process actually takes a lot longer and the 21 days idea is based on anecdotal evidence.
The initial 21 days idea is thought to have come from Maxwell Maltz's self-help book, Psycho Cybernetics:
It usually requires a minimum of about 21 days to effect any perceptible change in a mental image. Following plastic surgery it takes about 21 days for the average patient to get used to his new face. When an arm or leg is amputated the "phantom limb" persists for about 21 days. People must live in a new house for about three weeks before it begins to "seem like home". These, and many other commonly observed phenomena tend to show that it requires a minimum of about 21 days for an old mental image to dissolve and a new one to jell.
So, what does the above quote have to do with habit forming? Not much, really. If it is the basis for the 21 day habit forming idea, then it's based on an observation that doesn't really deal with forming habits. Still, it's obvious why the idea caught on: 21 days sounds like a feasible achievement.
Unfortunately, as the UCL blog points out, at least one habit forming study shows that most habits take a lot longer to form. They're also very dependent on the person and the habit in question:
It may be that some behaviours are more suited to habit formation — habit strength for simple behaviours (such as drinking a glass of water) peaked quicker than for more complex behaviours (e.g. doing 50 sit-ups) — or that people differ in how quickly they can form habits, and how strong those habits can become.
What's the magic number then? The study showed it was 66 days on average, but it's different for everyone and depends on how difficult a habit is to create (or break). Thankfully, as Psychology Today points out, missing a day across those 66 days isn't a terrible thing:
The study also showed that if you miss a day here or there when you're trying to develop a habit, it doesn't derail the process, so don't get discouraged if you can't keep a perfect track record. But the first days seem to make the biggest difference, so it's worth trying to be particularly diligent at the beginning of the attempted-habit-acquisition process.
While the research done at UCL was relatively small (just 96 participants) it was at least based on a study and not just an observation of patients. To truly form a habit you have to get to the point where it's automatic and you don't think about it. For small things, 21 days might be the perfect amount, but for something more complex it can take a lot longer. The lesson is to not give up after 21 days if something doesn't feel like it's sticking. Forming a habit might take a lot longer than that.