-- online Search!

How Habits Form and How to Design for Them Honestly

by kirupa   |  filed under Human Behavior

TL;DR

When we repeat an action in the same situation often enough, the situation starts the action without us deciding, and that automatic link is a habit. For a lot of people it takes a couple of months. Our apps can help honestly by fitting into an existing routine, keeping the action tiny, and prompting at the right moment.

  • It isn't willpower. People who usually eat popcorn at the movies ate stale popcorn about as readily as fresh, but only in the cinema, because the setting started the habit.
  • In Lally's study, the 39 people with a clear curve took a median of 66 days to get close to automatic, anywhere from 18 to 254, and one missed day didn't derail anyone. The 21-day rule is a myth.
  • BJ Fogg's B=MAP says a behavior needs motivation, ability, and a prompt at the same moment, so a tiny action prompted right after an existing routine beats a big ask sent at random.
  • Slot-machine-style variable rewards and guilt-trip streaks hook people instead of helping them. Let people pause, export their stuff, or leave whenever they want.

A lot of the apps we build only work if people come back. A journal is only useful if we write in it, and a plant app is only helpful if...the plants are still alive. The first week goes great, but by week three, a lot of our users have drifted away, and our usage chart looks like a ski slope.

That's when it is tempting to reach for streaks, badges, and guilt-trip notifications. Before we do any of that, we are going to look at how a daily behavior becomes automatic, which research we can trust, and how our app can fit into someone's day without tricking them.

Onwards!

What Is a Habit, Really?

Let's say we are building a journaling app called Linebook. It asks our users for one line a day, and that's it. First, we will look at a morning that already runs on its own:

A person's morning as four steps in a row: the alarm, a shower, pouring coffee, and checking the phone, each one leading to the next. A thought cloud above the person asks, Is the demo ready for 10am? A callout says all of this happens on autopilot.

Nobody here decided to pour the coffee. The shower ended, and the coffee just happened while our person worried about a demo. Wendy Wood and her colleagues saw the same thing when college students wrote down what they were doing and thinking every hour. When the students did something they did just about every day in the same place, their thoughts often wandered somewhere else. Here is how much of what they wrote down fit that description:

Two bars for two hourly diary studies of college students. In Study 1, with 70 students, 35% of the behaviors they wrote down were done just about every day and usually in the same place. In Study 2, with 209 students, 43% were. The rest of each bar is everything else.

That is 35% of the behaviors in the first study and 43% in the second. These are students rating themselves, so the numbers are rough, but a big slice of an ordinary day runs without much deciding.

We have a name for those automatic actions. A habit is an action we've repeated so many times in the same situation that the situation itself starts the action. Wood and David Neal describe it as a link between a context (a place, a time, the action we just finished) and a response, built up slowly by repetition. We can picture this as a path across a lawn, where the more often we walk from our coffee to our journal over weeks and months, the deeper our groove gets:

Three lawns, each with a coffee mug on the left and a journal on the right. In the first week, there are only faint footsteps between them. A month in, a thin path has formed. Months later, the path is a deep groove worn into the grass.

In our picture, the coffee is the trigger, writing a line is the path, and all of our repetition wears it into a groove.

Isn't It Just Willpower?

A common belief is that people with good habits just have more willpower. If that were true, our job with Linebook would be to motivate people harder.

Nope. In one study by David Neal, Wendy Wood, and their colleagues, moviegoers got a bucket of either fresh popcorn or week-old stale popcorn. Here is what we see for the regular movie popcorn eaters:

People who usually eat popcorn at the movies, in two places. In a cinema, they ate about the same amount of week-old stale popcorn as fresh popcorn. In a meeting room, they ate less of the stale popcorn than the fresh.

In the cinema, they ate about as much stale popcorn as fresh popcorn. Nobody was using willpower to eat it. The cinema started the groove, and their hands followed it. In a meeting room, their taste buds got a vote again.

Brian Galla and Angela Duckworth found something related in six studies with 2,274 people. People with better self-control reported less effortful resisting, partly because they had stronger habits for things like exercise and sleep. For our app, this means motivation will get someone to write their first few lines, and repetition in the same situation is what keeps them writing.

How Long Does a Habit Take to Form?

You've probably heard that it takes 21 days to form a habit, which would make for a very tidy onboarding flow:

A joke software installer window titled Installing Habit 1.0. Its progress bar is empty, it says Estimated time remaining: 21 days, and it has a Cancel button.

Sadly, we don't get an installer. The number seems to come from Psycho-Cybernetics, a 1960 book by the plastic surgeon Maxwell Maltz. He wrote that his patients needed "a minimum of about 21 days" to get used to their new faces, and over the years the "minimum" fell off.

So, how long does it really take? The best-known measurement comes from Phillippa Lally and her colleagues, who had 96 volunteers pick a behavior, like eating a piece of fruit with lunch, and do it after the same daily event for 12 weeks. For the 39 people whose ratings formed a clear curve, it took a median of 66 days to get close to fully automatic, and anywhere from 18 to 254 days. In a 2024 review of 20 habit studies, the four that timed this landed in the same place:

A chart of days to form a habit, from 0 to 300. In Lally and colleagues' 2010 study, for the 39 of 96 people whose curves fit well, it took from 18 to 254 days, with a median of 66. In a 2024 review, the four studies that measured it found medians of 59 to 66 days, with individual people taking anywhere from 4 to 335 days. A dashed red line at 21 days marks the 21-day myth, well short of both.

For our app, this means a habit will take a couple of months for a lot of our users, and some will take far longer. A 21-day challenge would congratulate most of them long before their groove is worn in. Lally also found that missing a single day did not materially derail anyone:

A row of 14 days, each with a check mark except day 9, which was missed. Above them, a curve showing how automatic the behavior feels keeps rising across all 14 days, with only a tiny dip at the missed day. A callout says Barely a blip.

We will need that missed day again when we get to streaks.

What Has to Happen for Someone to Act?

Before our user's groove can form, they have to walk the path the first time. BJ Fogg, who founded the Behavior Design Lab at Stanford, says three things have to line up for any single action. Our user has to want to do it a little, it has to be easy enough, and something has to say "now":

Three cards on the left: Motivation, wanting to do it at least a little; Ability, easy enough to do right now; and Prompt, something that says now. Lines from all three join and lead to a card on the right where someone writes one line. Under it: all three, at the same moment.

Fogg writes this as B=MAP: behavior happens when motivation, ability, and a prompt come together at the same moment. If we are missing any one of them, nothing happens. A hard action needs a lot of motivation, and an easy one needs very little. Fogg's action line marks where a prompt starts to work:

A chart with motivation going up and ability going from hard to easy. A curved line, the action line, sweeps from the top left down to the bottom right. Prompts work above it and fail below it. At the same low motivation of a tired evening, the prompt to write 500 words lands below the line, and the prompt to write one line lands above it.

Look at our two Linebook asks. On a tired evening, the prompt to write 500 words lands below the line, so our user ignores it. The prompt to write one line lands above it, so our user writes, and their motivation hasn't changed at all.

Fogg's Tiny Habits method builds on this. We attach a tiny version of the new behavior to a routine our user already has (Fogg calls it an anchor), and then they celebrate a little. His recipes follow the pattern "After I..., I will...", and our Linebook recipe looks as follows:

A recipe card with three rows. After I pour my morning coffee, with a coffee icon. I will write one line in Linebook, with a memo icon. Then I tell myself Nice!, with a party popper icon.

The coffee does the reminding, so our user does not have to remember anything. Peter Gollwitzer studied a close cousin of this called implementation intentions (aka if-then plans), where our user decides ahead of time exactly when and where they will act:

Two cards. On the left, a goal: I want to journal more. On the right, an if-then plan: If it's 8am and my coffee is poured, then I open Linebook and write one line. Under the plan: 94 tests, 8,461 people.

A meta-analysis by Gollwitzer and Paschal Sheeran across those 94 tests found that adding a plan like this had a medium-to-large effect on reaching a goal. Following through on a goal isn't quite the same as forming a habit, but it will do nicely.

How Do We Fit Into Someone's Routine?

All of this points at one design move. Instead of inventing a new moment in our user's day, we will attach Linebook to one that already exists. During onboarding, our users will pick it, like the morning coffee or the bus ride home.

Instead of nudging whenever our numbers get nervous, Linebook nudges once, right after the moment our user picked:

Two timelines of the same day from 6am to midnight. Random reminders: bells at 10:40am, 2:47pm with a We miss you! bubble, and 11:30pm. At the moment they picked: one bell at 8:05am, right after the morning coffee at 8am.

The 2:47pm "We miss you!" lands in the middle of a meeting. The 8:05am nudge lands while the coffee is still warm, and tapping it opens straight to an empty line. It is the same instinct as asking for permissions at the right moment.

There is a catch, though. Because the context starts the habit, changing the context can stop it. Wood and two colleagues followed students who moved to a new university, and their habits survived only when parts of the setting stayed the same, like still reading the newspaper with other people. For our users, a vacation is a tiny version of that move:

Two lawns. At home, a deep groove runs from the coffee mug to the journal, and the habit runs on its own. On vacation, there's no familiar mug and no path to the journal, so we're back to deciding, shown by a thinking face.

Our user's kitchen is gone for a week, so we can offer a temporary anchor, like "after I sit down for breakfast," or simply wait for them to get home.

Where Does Habit Design Turn Into Manipulation?

Everything so far boils down to a few honest moves for our app:

  • Fit into a routine our user already has.
  • Make our action tiny, like one line instead of a page.
  • Prompt at the moment our user picked.
  • Let our users pause, export, or leave whenever they want.

Nir Eyal's book Hooked describes a much more popular playbook, a four-step loop for products people come back to on their own:

A loop of four steps with arrows going clockwise: Trigger, with a bell; Action, with a pointing finger; Variable reward, with a slot machine; and Investment, with a box being filled, which leads back to the trigger.

A lot of this loop overlaps with what we've seen. The step that worries me is the variable reward, where the payoff changes unpredictably every time. Eyal himself points to slot machines as a classic example:

A joke slot machine labeled Linebook. Its three reels show a journal, a flame, and a star, a lever sticks out of its side, and its display says You won a mystery badge! Spin again tomorrow.

A journal doesn't need a jackpot, and random mystery badges would teach our users to come back for the badge instead of the writing. Streaks are the other trap, and a coding agent can add one to our app in about five minutes. A streak turns into a problem when the fear of losing it becomes the reason to show up (if a cartoon owl has ever guilt-tripped you, you know the feeling). Here are two notifications Linebook could send at 8:05am:

Two phones, each showing a Linebook notification. The left one, labeled Guilt, says: Your 41-day streak dies at midnight! Don't let us down. The right one, labeled An honest nudge, says: Coffee's ready? One line, if you feel like it, with Write and Pause a week buttons.

Remember Lally's missed day? One miss didn't hurt anyone's habit, but a streak that resets to zero says the opposite. If Linebook shows a streak at all, it can count total days written instead.

Eyal's own gut check asks whether we would use our product ourselves and whether it materially improves people's lives, and a streak built on guilt fails that second question. Our last move is letting people leave cleanly, since lives change and our app should make quitting as easy as signing up was:

Linebook's settings screen with four rows: Daily reminder at 8:05am after coffee, Pause reminders for a week, Export all entries as a text file, and Delete my account. A callout says One tap each, no guilt trip.

If someone stops writing, that's their call, and our job is to make sure their entries leave with them.

What's Solid and What's Shaky?

Habit advice often goes past the evidence, so here is how I would sort the ideas we've covered:

A list of seven ideas, each with a label. Repeating something in the same context builds habits: solid evidence. If-then plans help people follow through: solid evidence. Habits take about 66 days: some evidence. Missing one day doesn't reset a habit: some evidence. B=MAP and Tiny Habits: design model. Cue, routine, reward and the Hook Model: design model. 21 days to form a habit: myth.

Repetition in a stable context and if-then plans both have a lot of support behind them. The 66 days is shakier. It comes from one study where only 39 of the 96 volunteers had a clean curve and everyone rated themselves. Anything past day 84 is also a projection (that's when the study ended). Charles Duhigg's The Power of Habit popularized the loop of a cue, a routine, and a reward, which simplifies the research. B=MAP and the Hook Model are design models, and I couldn't find a direct test of either one as a whole. They are great for asking better questions about our designs, as long as we don't treat them like laws of physics.

Try It This Week

Grab whatever you're building and give this a go:

  1. Write down your core action, and shrink it until someone could do it on their worst day.
  2. Find the prompt for that action: a moment that already happens right before it. Write it as an if-then plan, like "If I've just poured my coffee, then I write one line."
  3. Check every notification, streak, and badge you send, and move or delete anything that doesn't help at that moment.

Conclusion

Ok, it's time to wrap things up! A habit isn't something we power through with willpower. It is a groove that forms when we repeat the same action in the same situation, until the situation starts the action on its own. That takes a couple of months for a lot of us, and a missed day along the way is no big deal.

The honest version of habit design is pretty simple. We find a moment that already exists, make our action tiny, prompt right at that moment, and let people leave whenever they want. The limitation is that none of this makes anyone want our app. If Linebook doesn't make someone's day a little better, no amount of clever prompting will fix that, and that is probably how it should be.

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--