🔒 TOTP / 2FA Generator
Generate secrets, show a QR code to scan, verify 6-digit codes. RFC 6238 compliant.
Last updated: November 8, 2026 · By the BoltQuickTools team
Configuration
QR Code (scan with any authenticator app)
Current Code
Verify Code
Test a two-factor login while you build it
Adding authenticator-app codes to a login means checking that your server and a phone agree on the same six digits. This page generates a secret, shows its current code and tells you whether a code matches, so you can check each side during development.
Setting it up
- A secret is created when the page loads. Press New for another, or paste your own Base32 secret into the box.
- Set Issuer, Account, Digits (6, 7 or 8), Period (sec) (30 or 60) and Algorithm (SHA-1, SHA-256 or SHA-512). The otpauth URI line updates as you type.
- Read the code under Current Code and click it to copy. The bar below it shows how long the code has left.
- To check a code from another source, enter it under Verify Code and press Verify.
Example: checking against the published test vector
RFC 6238 publishes test values for the ASCII secret 12345678901234567890, which is GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ in Base32. Running this page's own code function on that secret with SHA-1 at Unix time 59 (counter 1) returns 94287082 for 8 digits and 287082 for 6 digits. The RFC lists the same 8-digit value.
The live display always uses your current clock, so you will not see those digits on the page. They are useful for checking your own implementation offline.
With that secret and the default Issuer and Account, the URI line reads:
otpauth://totp/BoltQuickTools%3Ayou%40example.com?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&issuer=BoltQuickTools&algorithm=SHA1&digits=6&period=30
Behaviour to expect
- Secret clean-up applies to codes only. Codes ignore case, spaces and any character outside A-Z and 2-7. The URI uses exactly what you typed, so
gezd gnbvappears there unchanged, with its space. Enter clean uppercase Base32 if you plan to reuse the URI. - A secret with no valid characters shows "invalid" in the code area. Verify then does nothing and displays no message.
- New secrets are 32 Base32 characters, which is 160 bits, drawn from the browser's cryptographic random source.
- Verify accepts three time windows: previous, current and next. A match reads "Match (window offset -1)", 0 or 1. It compares against the Digits, Period and Algorithm currently selected, so the field accepts up to 8 digits despite the hint mentioning 6.
- Non-default settings may not work in apps. Some authenticator apps ignore Digits, Period or Algorithm values other than 6, 30 and SHA-1, and will then show different codes from this page.
Secrets, mismatched codes and how the digits are made
Should I paste a real account's secret here?
The code runs through your browser's Web Crypto API and the page's script makes no network requests with it. The page still loads advertising and analytics scripts from other companies, like the rest of the site. Use generated or test secrets here, and keep live account secrets in your authenticator app.
Why does my phone show a different code?
Check that the secret and the three settings match, then compare the clocks on both devices. A clock that is off by more than one period produces different codes.
How do the codes work?
Each code is an HMAC of the current time step, cut down to a few digits. The TOTP explainer goes through it step by step, and the HMAC generator lets you try the underlying function by hand.
Does this help with storing passwords?
No, that is a separate problem. See password hashing in 2026 for it.