SSH key generator

Create an Ed25519 or RSA key pair for SSH logins, GitHub, GitLab and servers. The keys are made by your own browser with its built-in cryptography and are never sent anywhere.

Security note: the key pair is created on your device with the Web Crypto API, and nothing is uploaded or stored. For keys that guard production systems, the safest habit is still to run ssh-keygen on the machine that will use the key, so the private key never touches a browser or clipboard.

How to use the SSH key generator

  1. Choose the key type. Ed25519 is the best choice unless you need to connect to a very old server.
  2. Add a comment so you can recognize the key later, then click Generate Key Pair.
  3. Download both files. Put the private key in ~/.ssh/ and add the public key to your server or Git host.

Ed25519 or RSA?

Ed25519RSA 4096
SecurityVery strongVery strong
Public key lengthAbout 80 charactersAbout 730 characters
SpeedFastSlower to create and use
Works withOpenSSH 6.5 and later (2014), GitHub, GitLab, all current systemsEverything, including very old devices

Use Ed25519 unless something you connect to cannot handle it.

Installing the keys

Save the private key as ~/.ssh/id_ed25519 (or id_rsa) and lock down its permissions, or SSH will refuse to use it:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

Then copy the public key to the server:

ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
# or add the line by hand to ~/.ssh/authorized_keys on the server

For GitHub or GitLab, paste the public key into the SSH keys page in your account settings.

Add a passphrase

Keys made here have no passphrase, so anyone who copies the file can use it. Add one after saving the file:

ssh-keygen -p -f ~/.ssh/id_ed25519

Public and private: which is which?

The public key is one line starting with ssh-ed25519 or ssh-rsa. It is safe to share and goes on every server you log in to. The private key starts with -----BEGIN and must never leave your computer. If it leaks, remove the matching public key from your servers and make a new pair.

Need the right file permissions? See the chmod calculator. For email encryption keys, use the PGP key generator.

Frequently asked questions

Is it safe to generate SSH keys in a browser?

The keys are created on your device by the browser’s own cryptography and are not sent anywhere. For high-value systems, generating the key with ssh-keygen on the target machine is still the most cautious choice.

Which SSH key type should I use?

Ed25519. It is secure, fast and short. Choose RSA 4096 only for old systems that do not support Ed25519.

Where do I put the private key?

In the .ssh folder in your home directory, with permissions set to 600.

How do I add a passphrase?

Run ssh-keygen -p -f path/to/key after saving the private key.

Can I use the key with PuTTY?

Yes. Open the private key in PuTTYgen with Conversions › Import Key and save it as a .ppk file.