ForHosting KIT · Developer Utilities

Flashcard spaced repetition calculator

The flashcard spaced repetition calculator turns a review result into a concrete next study date.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Provide the date of the current review, the card's existing interval in days, and a recall quality from zero to five. The calculator applies a transparent, simplified SM-2 schedule and returns both the next interval and calendar date. It is useful for study tools, personal learning logs, and small applications that need consistent scheduling without a database, hidden state, or unpredictable model output.

Describe the card at the moment of review

Start with the date on which the learner reviewed the card, written as YYYY-MM-DD. This explicit date is important because it makes every calculation repeatable: running the same request tomorrow still produces the same answer. Then provide the current interval as a whole number of days. A value of zero represents a new card that has not yet earned an interval, while one represents a card due the day after its previous review. Finally, score recall quality from zero through five. Zero means the answer was completely forgotten, three is the lowest passing recall, and five represents an effortless, correct response. The scale is intentionally strict and accepts integers only. Keeping these three inputs small and explicit makes the calculator easy to connect to a study form, spreadsheet workflow, command-line tool, or flashcard application. It also prevents accidental dependence on a server clock, a user timezone, or review history that was never supplied in the request.

Understand the simplified SM-2 calculation

A quality below three is treated as failed recall, so the next interval resets to one day and the learner sees the material again soon. A passing review of a new card also receives a one-day interval. When a card already has a one-day interval and passes, its next interval becomes six days, following the familiar early SM-2 progression. For later successful reviews, the current interval is multiplied by an ease factor derived from the quality rating. The factor begins from the standard value of 2.5, rises slightly for perfect recall, and falls for more difficult passing recalls, with a floor of 1.3. The resulting number of days is rounded to the nearest whole day. This is simplified because it calculates from the supplied interval and rating without storing a separate repetition count or historical ease factor. The response includes the calculated interval, the next review date, the submitted quality, and a boolean indicating whether the review counted as recalled.

Use the result consistently in a study workflow

Store the returned next interval beside the flashcard and schedule the returned next review date in your queue. At the next session, send that stored interval back with the new quality rating and the date of that review. This creates a compact feedback loop in which difficult material returns quickly while confidently remembered material is spaced farther apart. The calculator validates dates as real Gregorian calendar dates, including leap years, and performs calendar addition rather than treating dates as ambiguous text. It also rejects fractional, missing, or out-of-range quality ratings instead of silently guessing, which helps catch broken user interfaces and imports. The algorithm is deterministic and uses no network access, random values, current clock, learner profiling, or artificial intelligence. That makes it suitable for reproducible tests and auditable education software. Treat its schedule as a practical baseline rather than a clinical promise: learners can adjust study plans for deadlines, fatigue, subject difficulty, or accessibility needs while retaining the same clear calculation rule.

Schedule a personal study deck

Turn each self-rated answer into the next due date without maintaining a complex scheduling service.

Add repetition to a learning app

Use a deterministic endpoint to update card intervals after learners submit recall ratings.

Audit a flashcard workflow

Recalculate stored schedules from review dates, intervals, and quality scores to verify consistent results.

What does the quality rating mean?

Use an integer from 0 for complete failure through 5 for perfect, effortless recall. Ratings of 3, 4, and 5 count as successful recall.

What happens when recall fails?

A quality below 3 resets the next interval to one day so the card returns quickly.

Is this the complete SM-2 algorithm?

No. It uses the recognizable SM-2 interval and quality-factor rules but does not persist a separate repetition count or historical ease factor.

Why must I provide the current date?

An explicit review date makes the result deterministic and avoids assumptions about the server clock or your timezone.

Can quality be outside 0 to 5?

No. Values outside 0 to 5, fractional values, and non-numeric values return an invalid input error.

What does an API request cost?

Each API request costs $0.002. The calculation is also suitable for the free browser experience.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/life/flashcard-spaced-repetition

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/life/flashcard-spaced-repetition \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"current_date":"2026-08-05","current_interval":10,"quality":4}'
{
  "current_date": "2026-08-05",
  "current_interval": 10,
  "quality": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "life.flashcard_spaced_repetition",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →