Article version: GitHub.com

Creating a strong password

Secure your GitHub account with a strong and unique password using a password manager.

You must choose or generate a password for your GitHub account that is:

  • Eight characters long, if it includes a number and a lowercase letter, or
  • 16 characters long with any combination of characters

To keep your account secure, we recommend you follow these best practices:

When you type a password to sign in, create an account, or change your password, GitHub will check if the password you entered is considered weak according to datasets like HaveIBeenPwned. The password may be identified as weak even if you have never used that password before.

GitHub only inspects the password at the time you type it, and never stores the password you entered in plaintext. For more information, see HaveIBeenPwned.

You can only use your password to log on to GitHub using your browser. When you authenticate to GitHub with other means, such as the command line or API, you should use other credentials. For more information, see "About authentication to GitHub."

Password-based authentication for Git is deprecated, and we recommend using a personal access token (PAT) when prompted for a password instead, which is more secure. Treat your token just like a password. For more information, see "Creating a personal access token."

Further reading

Ask a human

Can't find what you're looking for?

Contact us