One-time password (TOTP) generator

The six-digit code an authenticator app shows, generated here from your Base32 secret. RFC 6238, verified against the published test vectors.

Before you paste a secret

The secret is never sent anywhere, never written to browser storage and never put in the address bar. It exists only while this tab is open.

Even so: do not paste a real production two-factor secret into a machine you do not trust, including this one. Anything with access to this page can read what you type. Use it to test an implementation, to check a secret you control, or to get a code when your phone is not to hand.

1 · Your secret

The string the service gave you when you set up two-factor authentication — letters A to Z and digits 2 to 7.

2 · Settings

Almost every service uses SHA-1, six digits and thirty seconds. Change these only if yours told you to.

This is not the kind of one-time code a website texts or emails you. Those are generated on a server and sent over a channel; no web page can produce them. This is the authenticator-app kind only.


What this generates

This produces the six-digit code an authenticator app shows — the TOTP standard defined in RFC 6238, which Google Authenticator, Authy, 1Password, Microsoft Authenticator and almost everything else implement. Given the same secret and the same clock, this page and your phone produce the same code, because it is a pure function of the two.

What it is not

It is not the kind of one-time code a website sends by SMS or email. Those are generated on a server and delivered over a channel; no web page can produce them, and anything claiming otherwise is not telling the truth. This is the app-based kind only.

The secret never leaves your browser

It is not sent anywhere, not written to browser storage, not put in the address bar, not logged and not counted in any analytics. It lives in a variable for as long as the tab is open.

Even so, here is the advice that actually matters: do not paste a real production two-factor secret into a machine you do not trust, including this one. Anything with access to the page can read what you type into it. The honest uses are testing an implementation you are building, checking a secret you already control, or retrieving a code when your phone is not to hand.

Verified against the standard

The generator is checked against all eighteen published test vectors in RFC 6238 Appendix B, across SHA-1, SHA-256 and SHA-512. That is why the codes can be relied on rather than merely looking plausible.

Why SHA-1 is the default

Because that is what authenticator apps implement, almost without exception. SHA-1 is unfit as a signature hash, but the weakness does not carry over to HMAC, and a code generated with SHA-256 simply will not match one from a phone that assumed SHA-1.

When a code is rejected

Usually clock drift. Servers typically accept the code from one step either side, so the neighbouring codes are shown too — if the server accepted the previous one, your clock is behind. Beyond that, check the digit count and the period match what the service specified.

Related tools

See the HMAC generator, which is what a TOTP is built from, and the Base32 encoder.

Rate this tool

Was this tool useful? Your feedback helps us improve it.

No ratings yet — be the first to rate this tool.
Your rating (required)
0 / 2000

Please do not include passwords, payment details or other sensitive information.

Your feedback is sent privately to the A2Z.Tools team and will not be posted publicly.