How to set up TOTP two-factor codes
Those rotating six-digit codes from an authenticator app are TOTP. This guide explains how they work, what the setup secret is, and how to generate a code from a secret when you need to — without anything touching a server.
The fastest way
Paste a TOTP secret into the TOTP Generator and it shows the current six-digit code and its countdown. Read on for what's actually happening.
How TOTP works
At setup, the service and your authenticator share a secret key (shown as a QR code and a base32 string). From then on, both sides combine that secret with the current time to derive the same code, rotating every 30 seconds. Nothing is sent over the network — which is exactly why it keeps working offline.
Guard the secret, and back it up
The secret is the second factor. Anyone who has it can generate your codes, so treat it like a password — and keep a safe backup of it, or of the recovery codes the service gives you, so a lost phone doesn't lock you out.
When codes don't work
If codes are rejected, it's almost always clock skew. TOTP relies on accurate time; if your device clock drifts more than ~30 seconds, the codes won't line up. Turn on automatic network time to fix it.
Strong passwords still matter
Two-factor protects an account, but the password is still the first line. Generate a strong, unique one with the Password Generator.
A note on privacy
The TOTP Generator derives codes in your browser, so your secret is never uploaded to a server.