A free 2FA code generator: paste your two-factor authentication secret key and instantly get a one-time code to sign in to Google, Gmail, Google Ads or any other service that uses the TOTP standard. Nothing to install, no sign-up.
How to use the 2FA code generator
- Paste your secret key into the field above. It is usually 16 or 32 characters long — a service shows it when you turn on two-step verification (the “Can’t scan the QR code?” link).
- A six-digit code appears immediately and refreshes every 30 seconds — the timer shows how long it stays valid.
- Click the code or the “Copy” button and enter it on the sign-in page.
What the generator can do
- Several accounts at once — one key per line, each with its own code and label.
- Finds the key for you in a line like
login:password:keyorlogin|key— no need to cut it out by hand. - Reads otpauth:// links from QR codes, including non-standard parameters.
- Shows the next code in advance — handy when only seconds are left.
- Clock correction: if your device clock is off, the generator checks against the server and still gives a valid code.
- Flexible settings: 6 or 8 digits, a 30 or 60 second period, SHA1, SHA256 and SHA512.
- Link to your codes — bookmark it so you do not have to paste the key every time.
- “Hide keys” mode — for when you are sharing your screen.
How TOTP two-factor authentication works
One-time codes are created with the open TOTP standard (RFC 6238). The service and your device both know the same secret key. Every 30 seconds a new code is computed from the key and the current time, so it matches on both sides without any data being exchanged. This is how Google Authenticator, Microsoft Authenticator and this generator work: with the same key they all show the same codes.
Security: what to keep in mind
- The secret key is your second factor. Anyone who has it can generate codes, so store it like a password.
- The link to your codes contains the key. Do not send it in open chats or publish it.
- Save the backup codes from the service — they let you sign in if the key is lost.
- Do not turn on “Remember keys” on a shared or borrowed computer.
Running Google Ads?
PPC Rebels rents out Google Ads agency accounts from its own MCC: credit line, priority review and 24/7 support.
Google Ads agency accountsFAQ
What is a 2FA secret key and where do I get it?
It is a string of letters A–Z and digits 2–7 that a service gives you when you turn on two-step verification — together with a QR code or instead of it. In Google it is shown via the “Can’t scan the QR code?” link. The key is shown only once, so save it right away.
Why is the code not accepted?
Most often the device clock is inaccurate — the generator corrects for that automatically. Also check that the code has not expired, the key is pasted in full and belongs to this exact account. If two-factor authentication was set up again, the old key no longer works.
Is it safe to enter a key into an online generator?
The calculation runs in your browser using the built-in Web Crypto API, and the key is not sent to the PPC Rebels server. Still, treat the key like a password: do not enter it on other people’s devices and do not share a link that contains it.
Does it work for Google, Gmail and Google Ads?
Yes. It works with any service that uses the TOTP standard: Google, Gmail, Google Ads, Facebook, TikTok, Microsoft, GitHub, exchanges and hosting providers.
Can I get codes for several accounts at once?
Yes. Paste the keys one per line, optionally with a label: login|key. Each account gets its own card with a code, and the “Copy all codes” button collects them into one list.
How is it different from Google Authenticator?
The algorithm is the same, so the codes match. The difference is convenience: the generator opens in a browser on any device, needs no installation and handles several keys at once. A phone app is better for everyday personal use.
More useful stuff: a directory of ad and analytics services and the Google Ads blog.