FormatterHQ

SSH Key Generator

Create an OpenSSH private key and a matching public key line for GitHub, GitLab or a server's authorized_keys file, with the same SHA256 fingerprint ssh-keygen shows.

Output TEXT
Ready.

How to use the SSH Key Generator

  1. Choose the Key type: Ed25519 (recommended), RSA 3072 or 4096, or ECDSA P-256, P-384 or P-521.
  2. Enter a Comment that identifies the key, such as you@laptop.
  3. Click Generate SSH key.
  4. Save the private key block as ~/.ssh/id_ed25519 (or id_rsa / id_ecdsa) and the public line as the matching .pub file.

An SSH key generator that writes OpenSSH files

SSH keys let you log in to servers and push to Git hosts without typing a password. This ssh key generator creates a new key pair and writes it in the same formats as ssh-keygen: an OPENSSH PRIVATE KEY file and a one-line public key you can paste into GitHub, GitLab, Bitbucket or a server's ~/.ssh/authorized_keys. It is useful on machines where you cannot install OpenSSH, or when you need a throwaway key for a CI job or a test container.

What the output contains

Each run produces three things, labeled with the file names OpenSSH looks for by default:

  1. The private key, in the openssh-key-v1 format that starts with -----BEGIN OPENSSH PRIVATE KEY-----. It is not passphrase-protected.
  2. The public key line, such as ssh-ed25519 AAAA… you@laptop: the key type, the Base64 key blob and your comment.
  3. The fingerprint, in the SHA256:… form that ssh-keygen -lf prints and that GitHub shows in your account settings.

Example

An Ed25519 key with the comment you@laptop (private key shortened):

# ~/.ssh/id_ed25519  (private key — keep secret, chmod 600)
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
…
-----END OPENSSH PRIVATE KEY-----

# ~/.ssh/id_ed25519.pub  (public key — add to authorized_keys, GitHub, GitLab…)
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVLx4wxzOkI+wWkAGxpqgChUGw22RaCWyUBThEt/7CS you@laptop

# Fingerprint: SHA256:5oly3l8NHsMS29xBH+5F1h0XzIqVJzUiv5GZhLvO1i8

Choosing a key type

  • Ed25519: short keys, fast, and the default recommendation of current OpenSSH releases. Supported by GitHub, GitLab and any server running OpenSSH 6.5 or later.
  • RSA 3072 or 4096: choose it for old servers or network devices that do not support Ed25519. The public line starts with ssh-rsa, and modern OpenSSH signs with SHA-2 (rsa-sha2-256 or rsa-sha2-512) automatically.
  • ECDSA P-256, P-384, P-521: the ecdsa-sha2-nistp* key types. Some compliance profiles require NIST curves, which is the main reason to pick them.

Installing the key

  1. Save the private key and restrict it: chmod 600 ~/.ssh/id_ed25519. OpenSSH refuses keys that other users can read.
  2. Save the public line to ~/.ssh/id_ed25519.pub.
  3. Add a passphrase if you want one: ssh-keygen -p -f ~/.ssh/id_ed25519.
  4. Append the public line to ~/.ssh/authorized_keys on the server, or paste it into your Git host's SSH keys page.

Common errors and fixes

  • "UNPROTECTED PRIVATE KEY FILE!": the file permissions are too open. Run the chmod command above.
  • "invalid format" or "error in libcrypto": the file lost its final newline or gained Windows line endings while copying. Save it with Unix line endings and a trailing newline.
  • Permission denied (publickey): the public key is not in authorized_keys, or the server does not accept the key type. Compare fingerprints with ssh-keygen -lf.
  • Ed25519 not available: some older browsers lack Ed25519 in WebCrypto. Update the browser or choose ECDSA P-256.

SSH keys vs PEM keys

OpenSSH files are not interchangeable with PEM keys used by TLS and JWT libraries. For a PEM or JWK key pair use the RSA key generator or the ECDSA key generator. To get a certificate for HTTPS, start with the CSR generator.

Privacy

The key pair is generated with WebCrypto and encoded into OpenSSH format by code running in your browser. Nothing is uploaded or stored, and the key is lost when you leave the page, so save both files first.

Frequently asked questions

Is an SSH key generated online safe to use?
This generator runs entirely in your browser and never sends the key to a server, so the key is as private as your own device. For keys that protect critical production access, generating with ssh-keygen on the machine that will use the key is still the most conservative option.
How do I add a passphrase to the generated key?
Save the private key, then run ssh-keygen -p -f ~/.ssh/id_ed25519 and enter a new passphrase. OpenSSH rewrites the file in encrypted form, and the public key does not change.
Can I use this key with PuTTY on Windows?
PuTTY uses its own .ppk format. Open PuTTYgen, choose Load, select the OpenSSH private key file and save it as a .ppk. The Windows built-in OpenSSH client reads the file directly.
Which key type does GitHub recommend?
GitHub's own setup instructions use Ed25519, and it still accepts RSA and ECDSA keys. Ed25519 keys are short, which also makes the public line easy to copy.
Why does the private key have no password?
The generator writes the key unencrypted, the same as running ssh-keygen with an empty passphrase. If the key will live on a laptop or shared machine, add a passphrase afterwards with ssh-keygen -p and load it into ssh-agent.

Last updated September 26, 2026

Guides

Related tools

ECDSA & Ed25519 Key Generator Generate elliptic-curve key pairs (P-256, P-384, P-521) and Ed25519 keys as PEM or JWK for JWT signing, TLS and APIs. RSA Key Pair Generator Generate RSA 2048, 3072 or 4096-bit public/private key pairs in PEM (PKCS#8, PKCS#1) or JWK format with WebCrypto, entirely offline. Whirlpool Hash Generator Generate the Whirlpool hash of any text or file online. Instant 512-bit digest in hex, computed in your browser. WordPress Password Hash Checker Check if a password matches a WordPress user_pass hash ($wp$ bcrypt, $P$ phpass or legacy MD5). WordPress Password Hash Generator Create a WordPress password hash for the wp_users table: bcrypt for WordPress 6.8+ or phpass for older versions. SSL Certificate Decoder (X.509) Decode PEM or DER X.509 SSL/TLS certificates: subject, issuer, SANs, validity, key type, extensions and SHA-256 fingerprints. xxHash Generator Generate xxHash XXH32, XXH64, XXH3 and XXH128 hashes with an optional seed. Adler-32 Hash Generator Generate the Adler-32 hash of any text or file online. Instant 32-bit checksum in hex, computed in your browser. Argon2 Hash Generator Hash and verify passwords with Argon2id, Argon2i or Argon2d using custom memory, iterations and parallelism. Runs locally via WebAssembly. Bcrypt Hash Checker Check whether a password matches a bcrypt hash, like PHP password_verify, entirely in your browser. Bcrypt Hash Generator Generate a bcrypt password hash ($2y$) with a configurable cost factor, compatible with PHP password_hash and Laravel. BLAKE2b Hash Generator Generate BLAKE2b hashes (128–512 bits) with optional keyed MAC mode, from text or files.