DevToolStation

Keys & Generators

Key Pair Generator

RSA, ECDSA, Ed25519, ECDH and X25519 key pairs as PEM, JWK and OpenSSH public keys.

Loading the Key Pair Generator…

About the Key Pair Generator

Generate public/private key pairs with the Web Crypto API: RSA (2048 to 4096 bits) for signing or encryption, ECDSA and ECDH on P-256, P-384 and P-521, and Ed25519 and X25519. Export them as PEM (SPKI and PKCS#8) or JWK, and get an OpenSSH authorized_keys line for RSA, ECDSA and Ed25519.

How to use it

  1. Choose the algorithm and size or curve.
  2. Generate the key pair.
  3. Copy or download the public and private keys.

Frequently asked questions

Which key type should I choose?
Ed25519 for new signing keys and SSH. RSA 3072 where compatibility matters. ECDSA P-256 for JWT ES256 and most TLS uses.
Is it safe to generate a private key in a browser?
The key is created by the browser’s cryptography library and never leaves this page. Save it securely; it cannot be recovered.
Can I use the private key with ssh?
The PKCS#8 PEM works with OpenSSH for RSA and ECDSA keys. For Ed25519, ssh-keygen may need to convert it first.