consolelog.tools

Rate Limit Calculator

Calculate API rate limits, visualise backoff plans, and generate middleware code — live.

About this ToolHow it works, benefits & use cases

Translate a rate limit expressed as "N requests per period" into the numbers and code you actually need. Drag the three sliders — requests per period, the window in seconds, and an optional burst limit — and the tool computes the equivalent throughput per second, minute, hour, and day, plus how long to wait between requests to stay under the cap. It generates contextual recommendations (for example, batching advice when the per-second rate is below 1, or the minimum spacing between calls) and pre-loads the real limits of GitHub, Twitter, Stripe, and OpenAI with one click. A backoff table compares linear, exponential, and Fibonacci retry delays across five attempts against a 1-second base and 60-second cap. Finally it emits ready-to-use middleware: an express-rate-limit limiter and a token-bucket RateLimiterMemory from rate-limiter-flexible that honours your burst setting.

How to Use

  1. 1Drag the "Requests per period" and "Window" sliders to describe the limit, and set a "Burst limit" if your provider allows temporary spikes.
  2. 2Or click a provider preset — GitHub, Twitter, Stripe, or OpenAI — to load its real configuration.
  3. 3Read the per-second, per-minute, per-hour, and per-day stat cards to see the limit at different scales.
  4. 4Compare the linear, exponential, and Fibonacci columns in the backoff table to pick a retry strategy.
  5. 5Review the recommendations, then copy the generated express-rate-limit and token-bucket middleware from the output panel.

Key Benefits

  • Instant per-second / minute / hour / day breakdown from any "N per period" limit
  • One-click presets for GitHub, Twitter, Stripe, and OpenAI limits
  • Backoff comparison across linear, exponential, and Fibonacci over five attempts
  • Context-aware recommendations (batching, request spacing, sustained vs. burst)
  • Generated express-rate-limit middleware with the correct windowMs and max
  • Generated rate-limiter-flexible token-bucket config that respects your burst limit
  • Everything recomputes live as you move the sliders; state is shareable via URL

Common Use Cases

  • Planning client-side request pacing so you never trip a third-party API limit
  • Choosing a retry/backoff strategy by comparing delay growth side by side
  • Generating server-side rate-limiting middleware for an Express or Hono service
  • Estimating how long a bulk job will take under a given quota
  • Communicating an API's effective throughput to teammates with a shareable link

Configuration

1.389
Per second
83
Per minute
5,000
Per hour
120,000
Per day

Backoff plans

Delay before retry (ms) — 1 s base · 60 s cap · 5 attempts.

AttemptLinearExponentialFibonacci
#11.0 s1.0 s1.0 s
#22.0 s2.0 s1.0 s
#33.0 s4.0 s2.0 s
#44.0 s8.0 s3.0 s
#55.0 s16.0 s5.0 s

Live preview · express-rate-limit + rate-limiter-flexible

import rateLimit from 'express-rate-limit';

export const limiter = rateLimit({
  windowMs: 3600000, // 3600s
  max: 5000,
  standardHeaders: true,
  legacyHeaders: false,
});

// ─── token-bucket (burst-aware) ───

import { RateLimiterMemory } from 'rate-limiter-flexible';

const limiter = new RateLimiterMemory({
  points: 5000,
  duration: 3600,
});

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools