Get2FA

← All guides

How to set up GitHub 2FA with a TOTP app

GitHub requires 2FA for everyone who contributes code. It works with any TOTP app and shows the exact settings it uses, so it's one of the easiest services to set up.

Updated 2026-11-19

Have your secret key? Get your code nowOpen the 2FA generator

Step by step

  1. Click your profile picture → Settings.
  2. In the Access section, open Password and authentication.
  3. Click Enable two-factor authentication.
  4. Under the QR code, click setup key to see the TOTP secret. Save it.
  5. Add the key to your TOTP app (or Get2FA) and type the code under Verify the code from the app.
  6. Download your recovery codes and store them safely, then click I have saved my recovery codes.

The settings GitHub uses

If you set up an app manually, GitHub's documentation lists: type TOTP, issuer GitHub, label GitHub:your-username, algorithm SHA1, 6 digits and a 30-second period. These are the defaults in Get2FA.

More than one device

To use 2FA on several devices, scan the QR code with each of them during setup, or save the setup key and add it later. If 2FA is already on, you have to reconfigure the TOTP app in your security settings to see a new key.

Extra protection

After the TOTP app, you can add a security key, a passkey or GitHub Mobile as extra methods, so losing one device doesn't lock you out.

Keep a copy of the key

Before you scan the QR code, look for the option to see the key as text and save it in your password manager. If your phone is lost or replaced, you can paste that key into Get2FA or a new authenticator app and get your codes back in seconds. Never share the key or a screenshot of the QR code: anyone who has it can generate your codes.

Have your secret key? Get your code nowOpen the 2FA generator

Guides