DevTools Logo
All posts

The SuperMemo SM-2 Algorithm, Implemented in the Browser

August 28, 2026 · DevTools

flashcards
spaced-repetition
sm-2
study

Spaced repetition works because reviewing a fact right before you'd otherwise forget it is more effective than reviewing it on a fixed daily schedule — the trick is knowing when "right before you'd forget" actually is for a specific card. The Flashcards & Spaced Repetition tool runs the SM-2 algorithm, the same scheduling logic SuperMemo popularized in the late 1980s, transparently in the browser with your review history staying entirely local.

Rating a card 0 through 5

Each review asks you to self-rate recall quality from 0 (total blackout) to 5 (perfect, instant recall). A score below 3 resets the card — repetitions back to zero, interval back to one day — on the theory that if you genuinely struggled, the card needs to come back tomorrow regardless of how well-scheduled it was before. A score of 3 or higher advances the schedule instead.

How the interval grows

For a card that passes, the next interval depends on how many times in a row it's been recalled successfully: the first successful review schedules a 1-day gap, the second a 6-day gap, and every review after that multiplies the previous interval by the card's "ease factor" — so a well-known card's gaps grow geometrically (1, 6, 15, 38 days...) while a shaky one stays on a tight, frequent loop.

The ease factor is per-card, not global

Every card tracks its own ease factor, starting at 2.5 and nudged up or down after each review based on how far your rating was from a perfect 5 — struggle with a specific card repeatedly and its ease factor drifts down, which slows its interval growth even after you start recalling it correctly again; breeze through it and the ease factor climbs, compounding future intervals faster. That per-card memory is the entire point of SM-2 over a flat "review everything every three days" schedule.

What it doesn't do

This is scheduling, not content — you still write the cards. Pair it with the GPA & Grade Calculator if a grade depends on this material, or the Exam & Section Timer when it's time to test recall under actual time pressure instead of at your own pace.

Tools mentioned in this post