DevTools Logo

Retry & Backoff Calculator

Retry & Backoff Calculator

Turn retry parameters into a timeline with jitter envelopes, totals and copy-ready configs.

Runs in your browser

Enter a base delay, multiplier, cap, attempt count and jitter mode to see every retry as a timeline bar with a min/max envelope. The tool reports expected and worst-case cumulative waits, checks an optional deadline against the worst case, and emits axios-retry, tenacity, Polly and AWS-style snippets with your exact numbers. Jitter modes are none, full (uniform 0 to delay), equal (delay/2 + uniform half) and AWS decorrelated (min of cap and a random value between base and three times the previous delay). Everything runs locally.

Try an example

Retry parameters

No jitter — every client retries at exactly the same instant (thundering herd risk).

A cap of 0 disables the cap. Attempts are limited to 1–20 so pasted configs stay bounded.

Schedule

6 attempts

Totals

Expected 31.50 s · worst 31.50 s

Per-attempt backoff delays
#ExpectedEnvelopeCumulative
1500 ms500–500 ms500 ms
21 s1000–1000 ms1.50 s
32 s2000–2000 ms3.50 s
44 s4000–4000 ms7.50 s
58 s8000–8000 ms15.50 s
616 s16000–16000 ms31.50 s
1
500 ms
2
1 s
3
2 s
4
4 s
5
8 s
6
16 s

Config snippets

axios-retry
axiosRetry(client, {
  retries: 5,
  retryDelay: (count) => Math.min(30000, 500 * Math.pow(2, count - 1)),
  retryCondition: () => true, // none jitter envelope: see the timeline above
});
tenacity
@retry(
    stop=stop_after_attempt(6),
    wait=wait_exponential(multiplier=0.500, exp_base=2, max=30),
)
Polly
new AsyncRetryPolicy<HttpResponseMessage>()
  .WaitAndRetryAsync(6, attempt =>
      TimeSpan.FromMilliseconds(Math.Min(30000, 500 * Math.Pow(2, attempt - 1))))
AWS
base = 500 ms; cap = 30000; multiplier = 2
delay = min(cap, base * multiplier ** attempt)  // none jitter

Examples

Canonical exponential schedule

Input
base 500 ms, multiplier 2, cap 30 s, 6 attempts
Output
0.5 / 1 / 2 / 4 / 8 / 16 s — expected total 31.5 s.

The cap does not bind until much later; the last delay dominates the total wait.

Deadline breach

Input
same schedule with a 30 s deadline
Output
Deadline 30 s: exceeded (worst case 31.5 s).

Checking worst case rather than expectation avoids a pleasant surprise in production.

Full jitter

Input
base 500 ms, full jitter
Output
First attempt envelope 0–500 ms, expected 250 ms.

Spreading clients across the envelope reduces the thundering-herd effect after an outage.

About this tool

Retry & Backoff Calculator turns a few constants into the schedule they actually produce. Set a base delay, multiplier, cap, attempt count and jitter mode, then see every retry as a timeline bar with an expected value and a min/max envelope.

The schedule follows exponential backoff: attempt n waits for min(cap, base × multiplier^(n−1)). Four jitter modes are modelled deterministically: none, full (uniform 0…delay), equal (delay/2 + uniform half) and AWS decorrelated (min of cap and a random value between base and three times the previous delay). Expected and worst-case totals are computed from the same model, and an optional deadline is checked against the worst case.

Config snippets for axios-retry, Python tenacity, .NET Polly and AWS-style pseudo-code bake in the numbers you entered, so a review can compare the intended schedule with what the code will do. All math runs locally and nothing is uploaded.

What this tool does not do

  • Jitter statistics are expectation values and envelope bounds, not a simulation of a particular random seed.
  • Snippets are templates: library APIs change, so verify the emitted options against the version you use.
  • The tool models wait time only; it does not simulate request timeouts, circuit breakers or server load.
  • Decorrelated jitter uses previous expected delay rather than a sampled random delay, so it is a deterministic approximation.

How to use this tool

  1. Enter the retry constants

    Set base delay in milliseconds, a multiplier greater than 1, an optional cap (0 disables it) and 1–20 attempts.

  2. Choose a jitter mode

    None is deterministic, full and equal spread retries across an envelope, and decorrelated uses the previous delay as its upper bound.

  3. Add a deadline

    Enter a deadline in milliseconds to see whether the worst-case cumulative wait stays inside it.

  4. Read the timeline

    Bars show expected delay per attempt; the table lists expected value, envelope and cumulative wait.

  5. Copy a config

    Open a snippet section and copy the axios-retry, tenacity, Polly or AWS-style config with your numbers.

Use cases

Tune a flaky API client

See how a multiplier change affects total wait before shipping the config.

Review a pull request

Compare the retry constants in code with the schedule and deadline they imply.

SRE resilience planning

Choose jitter and caps that keep worst-case waits inside an SLA budget.

Jitter modes and envelopes

ModeEnvelope per attempt
noneExactly the exponential delay — simple, but clients can synchronise.
fullUniform 0…delay; expected delay / 2.
equaldelay/2 + uniform 0…delay/2; expected delay / 2.
decorrelatedUniform base…3 × previous delay, capped; expectation from the bounds.

Envelope maxima are used for the worst-case total; expectations use the mean of each distribution.

Common mistakes

Mistake:Leaving jitter off for many clients.

Fix:Use full or equal jitter so retries from different clients do not align.

Mistake:Using a multiplier of 10 without looking at the timeline.

Fix:Even three retries can mean minutes of waiting; check expected and worst-case totals.

Mistake:Comparing a deadline with the expected total.

Fix:The tool checks the deadline against the worst case, which is the safer bound.

Mistake:Counting attempts as retries in config snippets.

Fix:Snippets emit attempts − 1 retries where the library expects a retry count.

Frequently asked questions

What is exponential backoff?

Each retry waits longer than the previous one: delay = base × multiplier^(attempt − 1), usually capped. A 500 ms base with a multiplier of 2 gives 0.5, 1, 2, 4, 8 and 16 seconds for six attempts. The timeline makes the cumulative wait easy to see before you ship the config.

What is jitter and why does it matter?

Jitter randomises each delay so many clients that failed at the same time do not retry in lockstep. Full jitter picks uniformly from 0 to the delay, equal jitter keeps half the delay and randomises the rest, and AWS decorrelated jitter bounds the delay between the base and three times the previous delay.

What is the difference between full and equal jitter?

Full jitter can produce very short delays (even near zero) and has an expected value of delay / 2. Equal jitter never goes below delay / 2, trading a wider minimum for a smoother, more predictable retry pattern. Both have the same expected value and the same upper bound.

Why is the deadline checked against the worst case?

Because a deadline is a promise about the slowest path, not the average one. The calculator sums envelope maxima for the worst-case total; if that exceeds the deadline, the verdict flags a breach even when the expected total fits.

How many retries are reasonable?

It depends on the caller's latency budget. Five or six attempts with a cap are common for interactive clients; long batch jobs may allow more. Use the timeline to check the worst-case total and combine retries with timeouts and a circuit breaker rather than retrying forever.

Can I copy the result into my code?

Yes. The tool emits axios-retry, Python tenacity, .NET Polly and AWS-style snippets with the numbers you entered. They are templates: confirm the option names against the library version you use before deploying.

Does the calculator send my configuration anywhere?

No. All schedule generation, formatting and snippet emission happen in your browser tab, with no network requests or persistence.

References & standards