Skip to content
UniKit

TOTP debugger

Run a Base32 secret, Unix timestamp, code length and hash algorithm through RFC 6238 to get that time step’s code, plus the counter and seconds remaining.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Base32 secret
Fill in this machine’s current Unix seconds, then let the local algorithm run

One-time code

Computed locally in the browser per RFC 6238; the secret never leaves the page.

Enter a Base32 secret to see the result

Algorithm: - · Length: 0 · Time step: 0 · Seconds left: 0 · Timestamp: 0 · Secret bytes: 0

What this tool does

  • Debug why an authenticator app and your server disagree (align timestamp, code length and algorithm).
  • Verify your own TOTP implementation against the RFC 6238 Appendix B vectors.

Example

Input

MFRGGZDFMZTWQ2LK

Output

462371

The example secret is the RFC 4648 §10 Base32 test vector (ASCII "abcdefghij"); with the default options (timestamp 0, 6 digits, SHA-1) it yields 462371, and the same secret at timestamp 59 with 8 digits yields 15765705.

Frequently asked questions

How do I enter the secret?

As Base32 (A–Z and 2–7); it is case-insensitive and spaces or = padding are allowed. Anything that is not valid Base32 raises an error instead of being used silently as plain text. The example MFRGGZDFMZTWQ2LK is the RFC 4648 §10 test vector, the Base32 of ASCII "abcdefghij".

How can I verify the output?

With the RFC 6238 Appendix B vectors (8 digits): take the Appendix B ASCII secrets, encode them as Base32 and paste them in. At T=59 seconds SHA-1/256/512 give 94287082 / 46119246 / 90693936; T=1111111109 gives 07081804 / 68084774 / 25091201; T=1234567890 gives 89005924 / 91819424 / 93441116. All 18 values are asserted one by one in this tool’s unit tests, so an implementation change fails immediately.

Where does the timestamp come from?

You provide it in Unix seconds: the pure logic defaults to 0 (1970-01-01T00:00:00Z) and never reads the system clock, so the same input always produces the same code. The "Current time" button reads this machine’s clock once and fills the field, which is handy when comparing against a phone; clock drift between devices is the most common reason TOTP codes disagree.

Which algorithms and lengths are supported?

Only the SHA-1 / SHA-256 / SHA-512 family defined by RFC 6238; md5, sha384 and friends raise an error instead of silently switching algorithms. Code length is 6–10 and defaults to 6 (most authenticators use 6 digits per 30-second window).

Keywords:TOTPRFC 6238Base32

Related tools