opyeb totplab

Checking a 2FA code offline, step by step

Without a network, or when the authentication server is down, a secret and a correct clock are still enough to confirm a code. A fixed order keeps it calm.

2026-11-29 · about 5 min

When this applies

Air-gapped lab equipment, a laptop with roaming off abroad, or an authentication server under maintenance — situations where installing an authenticator is not an option.

With the secret and an accurate clock you can compute the code and check it. The actual login still has to happen on the service's own screen.

What you need

Three things: the Base32 secret, its algorithm, digit count and period, and a clock that is right in UTC.

You can read the secret from the authenticator's export function or from the service's re-enrolment screen. Keep it together with your recovery codes.

Entering the secret without a QR scan

Where you cannot scan a QR code, type the Base32 string. This tool normalises spaces, case and padding, then validates the characters and the length.

If you saved the otpauth:// URI, paste it into 'Fill from URI' instead; it fills the algorithm and digit count as well.

Fix the clock first

The most common cause of a failing code is the clock. Enable automatic time on the operating system and check the offset against UTC in seconds if you can.

Without a network, use GPS, a radio clock or another trusted device as the reference. The fixed-time mode here reproduces the code for a chosen moment.

Measure the offset with ±2

Put the received code into the verification box and five steps from −2 to +2 are compared. The matching offset is the clock error.

An offset of 0 means the clocks agree; ±1 or ±2 means they are that many steps apart. Multiply by the period to get seconds.

Checklist when a code fails

① Is the secret typed correctly? ② Is the algorithm SHA-1 or SHA-256? ③ Six digits or eight? ④ Period 30 or 60 seconds? ⑤ Is the clock right? Check in that order.

If all five are right and it still fails, the service settings may have changed. Re-enrolling to get a new secret is usually faster than guessing.

Writing it down

Record only the time, step number, offset, algorithm and digit count. Never record the code or the secret.

If the same problem returns, that record narrows the cause in minutes.

Limits and things not to do

This tool computes and displays codes; it does not log in for you. Do not send a computed code over chat or mail either.

On a shared computer, close the tab afterwards and check that the secret did not remain in history or the clipboard.

Questions in this article

Does it really work with no network?

Once the page is open, the computation runs offline. Web Crypto needs https or localhost, though, so if you opened a file directly, serve it locally instead.

How is this different from recovery codes?

Recovery codes are one-time substitutes used when the authenticator is lost; TOTP codes are 30-second one-time values. Do not store them in the same place.

May I write the code down?

It is not recommended. A code expires in 30 seconds, but a note can be used within that time. Only the time and offset are worth recording.

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

Open the workbench
← All guides