Finding your GitHub username

Your GitHub username is the name you chose when you created your account — it appears in your profile URL and in the top right corner of GitHub when you are logged in. If you are already signed in, click your profile picture in the top right corner and select "Your profile" from the dropdown menu. The page that opens shows your username right below your display name.

If you are not logged in and need to find your username, go to github.com and look for the username in any repository you have created or contributed to. Your username also appears in the URL of your profile — it looks like github.com/yourusername. If you cannot remember your username at all, you can recover it by going to github.com/login and clicking "Forgot password?" — GitHub will ask for the email address associated with your account and send you a recovery link that includes your username.

Key Takeaways

  • Your GitHub username is visible in your profile URL (github.com/yourusername) and in the top right corner when you are logged in.
  • If you are logged out and cannot remember your username, use the password recovery flow on the login page — GitHub sends your username to your registered email.
  • Your password is never displayed anywhere on GitHub for security reasons; you can only reset it through the "Forgot password?" link.
  • Two-factor authentication adds a second security layer and is worth turning on if you store sensitive code or work on shared projects.
  • If you suspect someone else knows your password, change it when ready from your account settings under "Password and authentication."

Resetting your password if you cannot remember it

GitHub does not show you your password anywhere — that is intentional and keeps your account safer. If you cannot log in because you forgot your password, go to github.com/login and click "Forgot password?" at the bottom of the form. Enter the email address you used to create your GitHub account.

GitHub sends a password reset link to that email. The link expires after a few hours, so check your inbox (and spam folder) right away. Click the link, create a new password, and you will be logged in. Make sure your new password is at least 15 characters long or at least 8 characters if it includes uppercase, lowercase, numbers, and symbols — GitHub enforces these rules to protect your account.

Checking your account settings to confirm your username

Once you are logged in, you can see your username and other account details by clicking your profile picture in the top right corner and selecting "Settings." On the left side, click "Account" to see your username, the email address tied to your account, and when you created it. This page also shows whether you have two-factor authentication turned on.

Your username cannot be changed directly, but you can change your display name (the name that shows on your profile) separately. If you need a different username, you would have to create a new GitHub account — GitHub does not offer username transfers or changes.

Understanding password security on GitHub

GitHub stores passwords using bcrypt hashing, which means GitHub staff cannot see your actual password even if they wanted to. When you log in, GitHub compares what you type to the hashed version stored in their database. This is why GitHub can only reset your password — they cannot retrieve the old one.

If you use the same password on GitHub as you do on other websites, change it now. A data breach on another site could expose that password, and someone could use it to access your GitHub account and any code stored there. A password manager like Bitwarden, 1Password, or KeePass generates and stores unique passwords for each site, so you only have to remember one strong master password.

Setting up two-factor authentication for extra security

Two-factor authentication (2FA) requires a second form of proof when you log in — usually a code from your phone. Even if someone gets your password, they cannot access your account without that second code. GitHub offers two types: time-based codes (using an app like Google Authenticator or Authy) and SMS text messages.

To turn on 2FA, go to Settings > Password and authentication > Two-factor authentication and click "Enable two-factor authentication." GitHub recommends the authenticator app method over SMS because text messages can be intercepted. Save your recovery codes in a safe place — if you lose access to your authenticator app, those codes are the only way back into your account.

What to do if you think your password has been compromised

If you suspect someone else knows your password — because you used it elsewhere and saw a breach notification, or because you shared it by accident — change it when ready. Go to Settings > Password and authentication > Change password. You will need to enter your current password first, then create a new one.

After changing your password, review your account activity. Click Settings > Account > Sessions and look at the list of devices and locations where you have been logged in. If you see a login from a place you do not recognize, click the three dots next to it and select "Sign out" to end that session. If you have not turned on two-factor authentication yet, this is a good time to do it.

Frequently Asked Questions

Can I see my password if I am already logged in?

No. GitHub never displays your password anywhere, even when you are logged in. This is a security feature. If you want to change your password, go to Settings > Password and authentication > Change password and enter your current password to verify your identity before creating a new one.

What if the email address I used to create GitHub no longer works?

Go to Settings > Account and change your email address to one you can access now. GitHub sends a confirmation link to the new address. Once you confirm it, you can use that email to reset your password if you forget it in the future.

Is it safe to save my GitHub password in my browser?

Browser password managers are reasonably safe if your computer is not infected with malware. A dedicated password manager like Bitwarden or 1Password is more find because it stores passwords in an encrypted vault separate from your browser. Either way, use a unique password for GitHub — never reuse a password from another site.

How do I know if my GitHub account was in a data breach?

Check your email address at haveibeenpwned.com, a free tool that searches known data breaches. If your email shows up, change your password on GitHub and any other site where you used the same password. GitHub also notifies users directly if their account is compromised.

Can I log in with a passkey instead of a password?

GitHub supports passkeys as an alternative to passwords. Passkeys use your device's fingerprint or face recognition and are harder to steal than passwords. You can add a passkey in Settings > Password and authentication > Passkeys, but you still need a password as a backup method.