2FA Setup Guide
How to enable 2FA for your GitHub account
Updated June 5, 2026
Two-factor authentication (2FA) protects your GitHub account even if your password leaks. Follow the steps below to generate GitHub verification codes with the Authenticator App on your iPhone, iPad or Mac.
Download Authenticator App
Download Authenticator App from the App Store on your iPhone, iPad or Mac. It's free and no sign-up is required.
Open GitHub security settings
Click your profile photo → “Settings” → “Password and authentication”.
Enable two-factor authentication
Click “Enable two-factor authentication” and choose “Set up using an app”. GitHub will display a QR code.
Scan the QR code with Authenticator App
Open Authenticator App, tap the + button and scan the QR code shown by GitHub. If you can't scan it, choose the manual option on GitHub and type the setup key into the app instead.
Enter the 6-digit verification code
Type the 6-digit code from Authenticator App back into GitHub to confirm the setup. The code refreshes every 30 seconds.
Save your backup codes
If GitHub offers backup or recovery codes, download or write them down and store them somewhere safe. They let you regain access if you ever lose your device.
Get the Authenticator App
Scan the QR code from GitHub and generate secure one-time codes on iPhone, iPad and Mac. Free, no account required.
Download App