opyeb totplab

No upload, no storage — it happens in this tab

Two-factor codes,
computed here and nowhere else

Paste a Base32 secret and this page's JavaScript computes the TOTP or HOTP codes itself. It also builds the otpauth:// URI and the QR code locally, shows which of the five ±2 windows a received code falls into, and tells you how far your device clock has drifted. Zero server calls.

TOTP and HOTP workbench

The secret never leaves this browser · 0 sent · 0 stored · 0 external requests

Secret

Base32

Each button makes a new secret from a cryptographic random source (crypto.getRandomValues) and replaces the current one.

otpauth:// URI (current settings)
Fill from an otpauth:// URI
Enter a secret and the QR code appears.

The QR contains the secret in plain form. Mind screen sharing and captures.

TOTP code

TOTP

Code for the current step

— — — —
—s left

±2 step verification

±2

Enter a received code and five steps from −2 to +2 around the current step are compared. Useful when you suspect a clock difference.

±2 step window
Offset Code Valid range Result

The table shows the codes for five steps around the current (or fixed) time. They are secret material: hide them while screen sharing.

HOTP counter

HOTP

Step the counter up and down with the same secret to see how the code changes. Verification compares a ±2 range around the counter.

Counter
— — — —

Official RFC test vectors

The 18 TOTP vectors of RFC 6238 and the 10 HOTP vectors of RFC 4226, recomputed by this page and compared with the published values.

Official RFC test vectors
Vector Time / counter Published Computed Result

The TOTP vectors use 8-digit codes and the 20, 32 and 64-byte seeds defined by the RFC. They run independently of the secret you entered.

What is guaranteed, and what is not

  • Nothing is sentNo fetch, XHR, WebSocket or sendBeacon is used. Every script on the page ships in the package.
  • Nothing is storedNo localStorage, sessionStorage, cookie or IndexedDB write. Reloading leaves no trace.
  • The QR is local tooThe symbol is drawn by the encoder inside the page, not by an outside service.
  • No login on your behalfThis tool shows and checks codes; it never signs in to any service or submits a code.

How it works

  1. 01

    Bring the secret

    Generate a fresh 16, 20 or 32-byte secret, or paste the Base32 string or otpauth:// URI from your authenticator. Spaces, lowercase and padding are cleaned up for you.

  2. 02

    Read the code

    Choose the algorithm, digit count and period to see the current step's code and the seconds left. Fix the timestamp to reproduce any moment exactly.

  3. 03

    Verify and compare

    Enter a received code and five steps from −2 to +2 are compared: which one matched, and how many seconds the clocks disagree. The 28 official RFC vectors are checked the same way.

What is on one screen

Why the secret never reaches a server

A TOTP secret is a password. If it leaks once, every 30-second code leaks with it — so this tool is built with no path that could send it anywhere.

Five guides

From the arithmetic to the official vectors, clock drift, secret hygiene and offline checks — in order.

Frequently asked

Is the secret really not leaving my browser?

Correct. Input, computation, QR drawing and downloads all run in this page's JavaScript. No request carries the secret, and you can confirm that in the developer tools network tab.

Which authenticators does it work with?

Any app that follows RFC 6238 TOTP or RFC 4226 HOTP. SHA-1, SHA-256, SHA-512, 6 or 8 digits, and 30-second, 60-second or custom periods are supported.

Does a clock difference change the code?

Yes. TOTP feeds the 30-second time step into HMAC, so a skewed device clock produces a different code. This tool compares a ±2 window and reports the drift in seconds.

May I log in with a code generated here?

The arithmetic is correct, but the actual login is safer in your original authenticator or on the service's own screen. This is a lab for checking and diagnosing.

Where is the QR code generated?

The JavaScript shipped with the page draws it to ISO/IEC 18004. No secret is sent to a QR service.

Does it work offline?

Once the page is open, computing and verifying work with the network off. Web Crypto itself requires https or localhost.

Put a secret in and read the code

An example secret is already loaded. Replace it with yours and the code changes on the spot.

Open the workbench