A streak is the simplest motivation tool there is: a number that grows every day you show up and resets when you don't. Every habit app has one. Notion doesn't — and building one is harder than it looks, because Notion formulas have no loops. You can't just "count backwards from today until a day is missing".

This guide gives you two tested, copy-paste formulas for Notion: a current streak that counts consecutive days up to today, and a longest streak that finds your best run ever. Both use Notion's list functions instead of loops, both work on the free plan, and we explain how each one works so you can adapt them.

Current streakdays in a row up to today
Longest streakyour best run ever
Last 7 daysa softer weekly count

The Setup: Habits + Check-ins

Streak formulas need one row per completed day, so use two databases:

  • Habits — one row per habit ("Read 20 pages", "Workout").
  • Check-ins — one row each time you do a habit, with a Date (date only, no time), a Done checkbox and a Habit relation.

Turn on the two-way relation so each habit has a Check-ins property listing all its check-ins. The formulas below go on the Habits database. If you're starting from zero, our guide to building a habit tracking system in Notion covers the basic setup.

Formula 1: Current Streak

lets(
  days, prop("Check-ins")
    .filter(current.prop("Done"))
    .map(current.prop("Date"))
    .unique()
    .sort()
    .reverse(),
  offset, if(empty(days), 0,
    if(dateBetween(today(), days.first(), "days") == 1, 1, 0)),
  days
    .filter(dateBetween(today(), current, "days") == index + offset)
    .length()
)

How it works

  1. Collect the dates. Take the habit's check-ins, keep the ones marked Done, turn them into a list of dates, remove duplicates (unique()) and sort them from newest to oldest.
  2. Allow for today. If you haven't checked in yet today, your streak shouldn't show 0 at breakfast. The offset is 1 when the newest check-in is yesterday, so the count starts from yesterday instead.
  3. Count the unbroken run. In an unbroken streak, the newest date is 0 days ago, the second is 1 day ago, the third 2 days ago, and so on. So we keep only dates whose distance from today equals their position in the list (index). The first gap breaks the pattern, and every older date stays out of step, so only the current run is counted.

Example: check-ins today, yesterday, two days ago, then a gap, then four more days. The formula returns 3. With no check-in today yet but the same three days ending yesterday, it still returns 3. If the last check-in was two days ago, it returns 0 — the streak is broken.

Formula 2: Longest Streak

lets(
  days, prop("Check-ins")
    .filter(current.prop("Done"))
    .map(current.prop("Date"))
    .unique()
    .sort(),
  keys, days.map(
    formatDate(dateSubtract(current, index, "days"), "YYYY-MM-DD")),
  if(empty(days), 0,
    keys.map(lets(k, current, keys.filter(current == k).length())).max())
)

How it works

This uses a classic trick from data analysis, sometimes called "gaps and islands". Sort the dates from oldest to newest, then subtract each date's position in the list from the date itself:

Check-in datePosition (index)Date − index
3 Nov03 Nov
4 Nov13 Nov
5 Nov23 Nov
8 Nov35 Nov
9 Nov45 Nov

Every day in an unbroken run produces the same result, and a gap produces a new one. So the formula turns each date into that "key", counts how many times each key appears, and takes the maximum. In the table, 3 Nov appears three times and 5 Nov twice, so the longest streak is 3.

Performance: both formulas look at every check-in of a habit. That's fine for a few years of daily data. If a habit has thousands of check-ins, add .filter(dateBetween(today(), current.prop("Date"), "days") < 400) after the first filter to the current-streak formula to keep it fast.

Making It Look Good

Numbers work, but a styled line is easier to read in a gallery card or on a dashboard. Combine both formulas into one display formula (assuming you named them Streak and Best):

style(format(prop("Streak")) + if(prop("Streak") == 1, " day", " days"),
  "b", "green") +
style("  ·  best " + format(prop("Best")), "gray")

It shows something like 5 days · best 12. Add it to a gallery of your habits and you have a streak board.

Consistency OS in Notion: profile with level and XP, goals list and habit streak cardConsistency OS in Notion: profile with level and XP, goals list and habit streak card
Consistency OS: level, XP, goals and a habit streak card on one dashboard.

Useful Variants

Check-ins in the last 7 days

Strict streaks can feel brutal for habits you don't do daily. A rolling count is gentler:

prop("Check-ins")
  .filter(current.prop("Done") and
    dateBetween(today(), current.prop("Date"), "days") < 7)
  .length()

Show it as "4/7 this week" and set a target per habit (for example 3/7 for workouts).

A streak for the whole day, not one habit

If you'd rather track "days I completed my routine", put the same formula on a Profile page related to a Days database, and use a Complete checkbox or formula instead of Done.

Freeze days

Some apps let you protect a streak on sick days. In Notion you can add a Freeze checkbox to Check-ins and count those rows as done: replace current.prop("Done") with current.prop("Done") or current.prop("Freeze"). Limit how many freezes you allow per month, or the streak stops meaning anything.

Troubleshooting

  • The streak is off by one. Your Date property probably includes a time. Use dates without times, or wrap dates with parseDate(formatDate(current.prop("Date"), "YYYY-MM-DD")).
  • Two check-ins on the same day count twice. They shouldn't with unique(), but only if both dates are identical — another reason to avoid times.
  • The formula shows an error after pasting. Check that the property names match yours exactly: Check-ins, Done, Date. Notion formulas are case-sensitive.
  • The relation property is called something else. Replace prop("Check-ins") with the name of the relation on your Habits database.

Streaks are one of the four game mechanics that make habits stick. The others — XP, levels and rewards — are covered in how to gamify your habits in Notion and our Notion level formula guide.

Frequently Asked Questions

Can Notion track habit streaks?

Yes, with a formula. Store one check-in row per completed day in a Check-ins database related to Habits, then use a formula on the Habits database that counts consecutive dates up to today.

How do you calculate a streak in Notion without loops?

Sort the completed dates from newest to oldest and keep only the dates whose distance from today equals their position in the list. In an unbroken run they match; the first gap breaks the pattern, so the count equals the current streak.

How do I calculate the longest streak in Notion?

Sort the dates from oldest to newest and subtract each date’s position from the date. Every day in an unbroken run gives the same result, so counting how often each result appears and taking the maximum gives the longest streak.

Do these streak formulas work on the free Notion plan?

Yes. They only use relations and formulas, which are available on the free plan.

Consistency OS dashboard in Notion with profile level, goals and habit streakConsistency OS dashboard in Notion with profile level, goals and habit streak
Consistency OS: level, XP, goals and habit streaks on one Notion dashboard.

Get It Ready-Made

Consistency OS has current and longest streaks, Freeze Days, XP and 10 levels already built in, so you can start tracking today instead of debugging formulas.

See Consistency OS — $19 →