Runs locally · no upload

OTP Generator

Free online OTP generator. Create one-time passwords locally in your browser - no upload, no account, no tracking.

  • Secret never leaves your browser
  • Nothing you paste is uploaded
  • Works instantly, no signup

Last updated: Oct 26, 2026 10:37:49

Generate a one-time code

Waiting for a key

Computed in your browser: the secret is not uploaded and not stored. The page makes one analytics request and nothing else.

An OTP generator turns a shared secret into a short code that works once and then expires. That is the whole idea: even if someone watches you type the code, it is useless a minute later. This page generates one-time passwords in your browser — there is no request to a server, no account, and nothing stored.

Most people arrive here holding a Base32 string from an authenticator setup screen and needing one thing: the six digits, right now. If that is you, paste the key into the field above and read the result. The rest of this page explains what the code is, which parameters change it, and what to do when it does not work.

What an OTP actually is

A one-time password is a value computed from two inputs: a secret that both you and the service know, and something that changes over time or per use. The service never has to store your code, and the code never has to travel over the network to reach you. It is derived, not delivered.

That property is why OTPs are the backbone of two-factor authentication. A password can be replayed by anyone who sees it; an OTP is bound to a narrow window, so replaying it fails. The trade-off is that the code is only as good as the clock and the secret — which is exactly where most failures come from.

OTP vs TOTP vs HOTP: three names, two mechanisms

People use “OTP” loosely. Underneath, there are two constructions, and the difference matters when a code does not work.

Construction What changes each time Validity Needs a counter sync Typical use
TOTP (RFC 6238) The clock: every 30 seconds, a new time step One time step, plus the server’s tolerance window No — both sides just need the time Authenticator apps, Google/Microsoft/Apple accounts, banks
HOTP (RFC 4226) An integer counter that increments on every use Until the counter advances Yes — a lost count desynchronizes the device Hardware tokens, some legacy VPNs, printed scratch codes
“OTP” as a generic term Either of the above, or an SMS/email code Minutes Depends SMS verification, bank transfers

When someone says “authenticator code”, they almost always mean TOTP. When a code changes only after you press a button, it is HOTP. This tool handles both: paste a otpauth://totp/… or otpauth://hotp/… link and it switches automatically.

How to use this generator

  1. Get the secret. It is the Base32 string your service shows during setup, usually behind “Can’t scan the code?” or “Enter manually”. It looks like JBSWY3DPEHPK3PXP.
  2. Paste it into the field above. Either the raw key or the full otpauth:// link works. Spaces, dashes and lowercase letters are tolerated.
  3. Check the parameters. If your service uses SHA-256, 8 digits or a 60-second period, set them — otherwise the digits will look valid but be rejected.
  4. Read the code. It refreshes when the 30-second window rolls over. The bar under the code shows how much time is left; it turns orange in the last five seconds.
  5. Paste it into the login form promptly. A code entered at second 29 is already dead on arrival.

No step requires a network connection. Turn off Wi-Fi and the generator keeps working — that is the design, not a bonus feature.

Where the secret comes from

Three routes, in order of how often they work:

The secret is the crown jewel. Whoever has it can generate valid codes forever, without your phone. Treat it like a password, not like a code.

The four parameters that change the code

Parameter Default What happens if you get it wrong
Secret — Codes are simply wrong. A single mistyped character is enough.
Algorithm SHA-1 Codes are wrong. Most services use SHA-1; enterprise setups sometimes use SHA-256 or SHA-512.
Digits 6 Six digits look plausible but fail. Some banking and enterprise systems issue 7 or 8.
Period 30 s The code is valid but out of phase — you may hit the right value only by luck.

If you are unsure, try the defaults first. A wrong algorithm or digit count produces a code that looks perfectly normal, which is why this is the most common silent failure.

Why this page computes locally

A web page that asks for your 2FA secret is asking for something valuable, and that deserves scepticism. This one is built so you can check the claim yourself:

That is the difference between “we promise not to log it” and “the browser makes logging impossible”.

SMS codes are a different animal

A six-digit SMS code looks identical to an authenticator code, which causes a lot of confusion. They are not the same mechanism:

If the login screen says “we texted you a code”, this page cannot help. If it says “enter the code from your authenticator app”, it can.

What this page is not

Setting expectations saves support tickets:

What it does is narrow and reliable: one secret in, one correct code out, computed on your device.

When the code does not work

Four causes cover almost every case: clock drift, a mistyped secret, a code that expired while you were typing, and a service that expects different parameters. The first is by far the most common — a device that is 40 seconds off will produce codes that are always one step behind.

If the code is rejected, work through 2FA code not working before you reset anything. Resetting an account is the one step that can lock you out permanently.

To check parameters or decode a setup link, the TOTP generator shows how the time step and HMAC are applied; if you are wondering whether your app will agree with the result, the authenticator compatibility notes cover that. If you are new to the acronyms, start with what TOTP is — five minutes there saves a lot of guessing later.

Frequently asked questions

What is the difference between OTP, TOTP and HOTP?

OTP is the general term. TOTP derives the code from the current time and changes every 30 seconds; HOTP derives it from a counter that increments on each use. Consumer authenticator apps almost always use TOTP.

Is it safe to paste my secret key here?

The page cannot send it anywhere: a Content-Security-Policy limits outbound connections to this site plus one analytics host, and nothing is written to storage. Open the Network panel - the only request is the page-view counter, and your key is never part of it.

Why does a valid-looking code get rejected?

Usually the device clock is more than 30 seconds off, or the service expects a different digit count or period. A correct secret with the wrong parameters produces a plausible but always-invalid code.

Can I use this offline?

Yes. Turn off Wi-Fi after the page loads and the generator keeps working, because all maths happens locally.

Does it store my key?

No. There is no cookie, no local storage and no session record. Closing the tab discards the key.

What if my service uses 8 digits or SHA-256?

Select the matching values in the algorithm and digits fields, or paste the full otpauth:// link and they are set automatically.