File & privacy

Key Pair Generator

Public/Private Key Pair Generator

Ed25519, ECDSA and RSA key pairs in OpenSSH, PEM and JWK formats, generated in your browser.

About this tool

About Key Pair Generator

Create a fresh public and private key without installing OpenSSL. Pick Ed25519, ECDSA on the P-256 or P-384 curve, or RSA at 2048, 3072 or 4096 bits, and the key pair is generated by your browser's Web Crypto API. Export it the way your software expects: OpenSSH (an authorized_keys line and an id_ed25519-style private key file), PEM (SPKI public key and PKCS#8 private key, as used by OpenSSL, Node.js, Java and TLS tooling) or JSON Web Key for JWT and JOSE libraries. The SHA-256 fingerprint is shown in the same form as ssh-keygen and GitHub, so you can confirm the right key was added. Our OpenSSH encoder is tested against ssh-keygen: for a known key, ssh-keygen reads the private key file and prints the same public key and fingerprint. Nothing is uploaded: the private key exists only in this tab until you copy or download it. Private keys are exported unencrypted, so add a passphrase or store them in a secrets manager before you rely on them.

Built and maintained by Abhi JainUpdated

How to Generate a Key Pair

  1. 1

    Choose the algorithm

    Pick Ed25519 for SSH and signatures, ECDSA P-256 for ES256 JWTs, or RSA when older systems need it.

  2. 2

    Choose the format

    Select OpenSSH, PEM or JWK. For OpenSSH, add a Comment such as you@laptop.

  3. 3

    Generate

    A key pair is created as soon as you pick the algorithm. Click Generate new key pair for another one.

  4. 4

    Save both keys

    Copy or download the public key and the private key. Keep the private key secret and never share it.

Key Pair Generator: questions and answers

Which key type should I choose?

Ed25519 for SSH and new signing systems: it is fast, short and resistant to implementation mistakes. ECDSA P-256 for JWT ES256 and TLS. RSA 3072 or 4096 only when a system doesn't support elliptic curves.

Are keys generated in the browser secure?

Yes. Web Crypto uses the operating system's cryptographically secure random generator and the browser's audited crypto library, the same code that protects HTTPS. The keys are never sent anywhere.

What is the difference between PEM, OpenSSH and JWK?

They are encodings of the same key. PEM wraps DER (SPKI for public, PKCS#8 for private) in Base64 armour; OpenSSH uses its own wire format for authorized_keys and id_* files; JWK is JSON (RFC 7517) for web token libraries.

Is the private key encrypted?

No, it is exported in plain form so every tool can read it. Protect it afterwards, for example with ssh-keygen -p for OpenSSH keys or openssl pkcs8 -topk8 -v2 aes-256-cbc for PEM keys.

How is the fingerprint calculated?

SHA-256 of the OpenSSH public key blob, Base64-encoded without padding and prefixed with SHA256:, exactly as ssh-keygen -lf and GitHub's SSH keys page display it.

Ready-made Key Pair Generator presets