On this page
Cloudflare controls DNS, security rules and traffic for websites, so a hijacked Cloudflare login can take a whole site offline. Cloudflare supports two-factor authentication with security keys and with a mobile authenticator app. The app method shows a QR code and a key; paste the key above to generate the 6-digit code Cloudflare asks for.
Developers and site administrators can use this page to read the code on the same machine they are working on. The calculation happens in your browser, so the key stays local. Keep the key and Cloudflare's backup codes in a secure vault, especially if your account is a super administrator for an organization.
How to find your Cloudflare secret key
- Log in to the Cloudflare dashboard and open My Profile from the user menu.
- Select Authentication (sometimes listed under Security).
- Under Two-Factor Authentication, choose to set up Mobile App Authentication.
- Cloudflare shows a QR code; use the option to view the key for manual entry and copy it. Labels may vary as the dashboard changes.
- Save the key privately before continuing.
How to log in to Cloudflare with the code
- Paste the Cloudflare key into the generator above.
- Copy the 6-digit code and enter it in Cloudflare's verification field, along with your password if requested.
- Save the backup codes Cloudflare provides, then use this page for future logins.
Cloudflare 2FA tips
- Store Cloudflare's backup codes outside your main device. They are the most reliable way back in if you lose the key.
- Super administrators can require 2FA for all members of an account. Turn it on for teams with access to production zones.
- API tokens are separate from your login 2FA. Scope them tightly and rotate them, since 2FA does not protect a leaked token.
Your Cloudflare key is processed only in this browser and is never uploaded. Keep a copy in an authenticator app or password manager as well.
Cloudflare 2FA FAQ
Can I use a security key instead?
Yes. Cloudflare supports hardware security keys, which offer phishing resistance. You can register both a key and an authenticator app; this generator works with the authenticator app method. Having both means a lost key is not a lockout.
Why does Cloudflare reject my code?
Check your computer clock, confirm you are using the latest key, and make sure the code has time left before it expires. If 2FA was reset by an admin, request a new setup.
Does this affect Cloudflare API access?
No. API tokens and API keys authenticate separately and do not require a 2FA code. Login 2FA protects the dashboard, so keep your tokens secure through scoping and rotation. Revoke any token you suspect has leaked.
Is it safe to use this for Cloudflare?
The key is processed locally and never sent to our server. Because Cloudflare protects critical infrastructure, use a trusted device and keep the key in a secure password manager as well.