2FA code generator
Generate time-based one-time codes (TOTP) from a secret or an otpauth:// link, to test sign-in flows.
The secret is the Base32 key shown when you set up two-factor sign-in.
Current code
Enter a secret to see its code.
Missing a feature or found a bug in 2FA code generator? Tell me on X (@_andrewtran) or by email.
How to use 2FA code generator
- Paste the Base32 secret or the whole otpauth:// link.
- Read the current code and the time left for it.
- Copy the code with the Copy button.
Questions and answers
Is my secret sent anywhere?
No. Codes are worked out by your browser on this device, and the secret is not stored. It is gone when you close the page.
Why does my code not match my app?
Codes depend on the clock. Check that the time on this device is right, and that the digits, period and algorithm match.
Should I use this for my real accounts?
An authenticator app on your phone is the safer home for real secrets. This tool is meant for building and testing sign-in flows.
Related tools
File hash checker
Get the SHA-256, SHA-1, SHA-384 and SHA-512 checksum of any file and verify a download.Image to Base64
Encode an image as a Base64 data URI, ready to paste into HTML or CSS.Colour converter
Pick a colour and convert it between HEX, RGB, HSL, HSV and OKLCH.CSS clamp() generator
Build a CSS clamp() for fluid font sizes and spacing that scale between two screen widths.