SSH Key Generator
Generate a new SSH key pair in seconds. Choose Ed25519 or RSA, then copy or download your public and private keys in OpenSSH or PuTTY (.ppk) format.
Runs in your browserEd25519 & RSAOpenSSH & PuTTYFree, no sign-up
Fingerprint:
Keep your private key secret. Never share it or paste it into another website. Keys made here have no passphrase. To add one after saving, run ssh-keygen -p -f ~/.ssh/id_ed25519.
Keys are generated in your browser with the Web Crypto API. Nothing is uploaded or stored.
Why CodeBrowser
A safer, simpler way to generate SSH keys
Command line
How to generate an SSH key with ssh-keygen
Prefer the terminal? ssh-keygen is built into Windows 10 and 11, macOS and Linux. Open a terminal (PowerShell on Windows) and run one of these commands:
Ed25519 (recommended)
ssh-keygen -t ed25519
RSA 4096 (older systems)
ssh-keygen -t rsa -b 4096
ssh-keygen asks where to save the key (press Enter to accept the default, ~/.ssh/id_ed25519) and for an optional passphrase. The -t option sets the key type, -b sets the key size for RSA, and you can add -C "work-laptop" to label the key so you can tell your keys apart. Then save your servers and keys in one place with the SSH Config Generator.
Setup
How to add your SSH key to a server
Save both files
Put them in your .ssh folder: ~/.ssh on macOS and Linux, or C:\Users\YourName\.ssh on Windows.
Protect the private key
On macOS or Linux, make it readable only by you: chmod 600 ~/.ssh/id_ed25519
Copy the public key
Run ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server, or paste the key on its own line in ~/.ssh/authorized_keys on the server.
Connect
Log in with ssh user@server. You won’t be asked for the account password.
GitHub, GitLab and most hosting control panels also have an “SSH keys” page where you can paste your public key directly. New to this? Follow our step-by-step guide on how to SSH into a server.
Key types
What is Ed25519?
Ed25519 is a modern public-key signature algorithm built on the Curve25519 elliptic curve. It’s the default key type in current versions of OpenSSH and the one GitHub recommends.
An Ed25519 key is short (the whole public key fits on one line), quick to generate and verify, and offers security comparable to a 3072-bit RSA key. The private key is saved as id_ed25519 and the public key as id_ed25519.pub, which starts with ssh-ed25519.
Ed25519 vs RSA: which SSH key should you use?
| Ed25519 | RSA 4096 | |
|---|---|---|
| Security | Strong | Strong |
| Public key length | About 80 characters | About 720 characters |
| Speed | Very fast | Slower to generate and sign |
| Compatibility | OpenSSH 6.5+ (2014) and nearly all modern clients | Works everywhere, including very old systems |
Use Ed25519 unless you need to connect to an older system that doesn’t support it. If you do need RSA, use at least 3072 bits. 4096 is a safe choice.
FAQ
SSH key questions, answered
Where are SSH keys stored?
By default, in the .ssh folder in your home directory: ~/.ssh/ on macOS and Linux, and C:\Users\YourName\.ssh\ on Windows. The private key is named id_ed25519 (or id_rsa), and the public key has the same name with .pub on the end.
Which key do I share, the public or the private key?
Only the public key: the .pub file, which starts with ssh-ed25519 or ssh-rsa. Your private key never leaves your computer. Anyone who has it can log in as you.
How do I add a passphrase to my SSH key?
Run ssh-keygen -p -f ~/.ssh/id_ed25519 and enter a new passphrase when asked. For a .ppk file, open it in PuTTYgen, type a passphrase in the Key passphrase fields and click Save private key.
Can I convert a key between OpenSSH and PuTTY formats?
Yes. Open the key in PuTTYgen with Load. Use Save private key to create a .ppk file, or Conversions, then Export OpenSSH key, to create an OpenSSH file.
Should I use RSA 2048 or 4096?
A 2048-bit RSA key is still considered secure, but 4096 bits gives you more headroom for the future. If the system you are connecting to supports Ed25519, it is a better choice than either.
Does ssh-keygen work on Windows?
Yes. Windows 10 (version 1809 and later) and Windows 11 include the OpenSSH client, so you can run ssh-keygen in PowerShell or Command Prompt without installing anything.
Ready to create your SSH key?
It takes about two seconds, and your keys never leave your browser.