Why it matters
Building or debugging two-factor login means comparing codes: is the server's clock off, is the secret decoded correctly, is the period or algorithm different from the app's? An authenticator app on your phone can't tell you any of that.
This generator uses the browser's WebCrypto to compute the same codes as Google Authenticator, 1Password and others, shows which time step you're in, and checks a code against nearby steps. It's for testing; keep real account secrets in a proper authenticator.
How it works
- InputA Base32 secret or an otpauth link
- In your browserHMAC with WebCrypto (RFC 6238)
- OutputCurrent codes, a QR link and a verifier
Where it fits in a designer's workflow
- Plan
- Design
- Build
- Test
- Launch
By the numbers
Show the numbers as a table
| Time (Unix seconds) | Tool | RFC 6238 |
|---|---|---|
| 59 | 94287082 | 94287082 |
| 1111111109 | 07081804 | 07081804 |
| 1111111111 | 14050471 | 14050471 |
| 1234567890 | 89005924 | 89005924 |
| 2000000000 | 69279037 | 69279037 |
How to use it
- Make a new secret, or paste one or an otpauth link.
- Set the algorithm, digits and period to match your server.
- Compare the current code with your app's.
- Check a code to see which time step it belongs to.
FAQ
Why doesn't my code match?
Usually the clock (check your device's time), the algorithm (most apps only support SHA-1) or the period (normally 30 seconds).
Is the secret sent anywhere?
No. Codes are computed in your browser. Even so, don't paste secrets for real accounts into any website.
Can I scan a QR code with it?
It writes the otpauth:// link. Turn it into a QR code with the QR Code Generator to scan it with an app.
What's the drift window?
How many 30-second steps either side of now a server accepts. One step either way is common.