Skip to content
OTP Generator

GitLab 2FA code generator

Paste your GitLab two-factor secret key to get the current 6-digit login code, the same one your authenticator app shows.

Find it under “Can’t scan the QR code?” when you turn on 2FA. Only have the QR?

2Your code will appear here
Paste a key to start
Calculated in your browser. Your key is never sent anywhere.
On this page

GitLab supports two-factor authentication with a one-time password authenticator, and administrators of self-managed instances or groups can make it mandatory. When you enable it, GitLab shows a QR code and the key for manual entry. Paste the key above to get the current 6-digit one-time password, both on GitLab.com and on your company's own GitLab server.

If you work across multiple GitLab instances, each one has its own key, so label them clearly. This page computes codes locally in your browser and sends nothing to a server. Keep each key backed up in an authenticator or password manager, and download GitLab's recovery codes immediately after setup.

How to find your GitLab secret key

  1. Sign in to GitLab, click your avatar and choose Edit profile (or Preferences).
  2. Open Account in the left sidebar and select Enable two-factor authentication.
  3. Under the QR code, GitLab shows the key for manual entry. Copy it. The exact layout varies by GitLab version.
  4. Save the key privately, noting which GitLab instance it belongs to.

How to log in to GitLab with the code

  1. Paste the GitLab key into the generator above.
  2. Copy the 6-digit code into the Pin code field and enter your current password if asked.
  3. Register the authenticator and download the recovery codes GitLab displays. Use this page for future one-time password prompts.

GitLab 2FA tips

  • GitLab shows recovery codes only after setup; download them right away and store them securely.
  • With 2FA enabled, git operations over HTTPS require a personal access token; SSH keys continue to work.
  • If your group or instance enforces 2FA, you may have a grace period before access is blocked. Set it up early to avoid interruptions.

Your GitLab key is processed only in this browser and is never uploaded. Keep a copy in an authenticator app or password manager as well.

GitLab 2FA FAQ

Does this work with self-managed GitLab?

Yes. Self-managed GitLab uses the same TOTP standard as GitLab.com. Each instance issues its own key, so use the key that came from the server you are logging into. Codes from one instance will not work on another.

What if my GitLab code is rejected?

Check your device clock and confirm you are using the key for the correct instance. On self-managed servers, ask your administrator to confirm the server's time is accurate, as server-side clock drift can also cause failures.

How do I regain access without my key?

Use one of your GitLab recovery codes. If you added an SSH key, GitLab.com also lets you generate new recovery codes over SSH. Otherwise, contact your instance administrator or GitLab Support.

Does this site store my GitLab key?

No. The key stays in your browser and is used only to compute the code. Do not save it in plain text on shared systems or in code repositories. A password manager is a safer place.

Get your GitLab code

Paste the GitLab setup key and copy the current 6-digit code in seconds.