RSA, ECDSA and Ed25519 key pair generator
Generate RSA 2048–4096, ECDSA P-256/P-384 or Ed25519 key pairs in your browser, as PEM and as OpenSSH keys.
Result
The result will appear here.Sometimes you need a key pair right now — to sign test JWTs, to configure a staging TLS endpoint, or to give a CI job its own SSH deploy key — and the machine in front of you has no OpenSSL. This page makes one with the browser's WebCrypto, the same implementation the browser uses for TLS, so the private key is created on your device and never exists anywhere else. You get the private key as PKCS#8 PEM (or an OpenSSH private key file), the public key as SPKI PEM, and the one-line OpenSSH public key for authorized_keys. The command-line equivalent is OpenSSL (openssl/openssl, 30k+ stars, Apache-2.0), which reads every PEM file this tool writes.
How it works
- Keys come from crypto.subtle.generateKey with the public exponent 65537 for RSA, the NIST curves for ECDSA, and Ed25519 where the browser supports it.
- The PEM halves are the standard containers — BEGIN PRIVATE KEY (PKCS#8) and BEGIN PUBLIC KEY (SPKI) — that OpenSSL, Node.js, Java, Go and every JWT library load without conversion.
- The OpenSSH line is encoded per RFC 4253, 5656 and 8709 and checked in tests byte-for-byte against keys made by ssh-keygen, with the same SHA256 fingerprint ssh-keygen -l prints.
- Choosing the OpenSSH private format writes an unencrypted openssh-key-v1 file, the format ssh-keygen has produced by default since OpenSSH 7.8.
Where your data goes
Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.
This tool handles keys and credentials, so nothing about a run is saved, not even to your own history.
What it costs
This tool is free, with no sign-in and no points.
Common questions
- Which key type should I pick?
- For SSH, Ed25519 saved in the OpenSSH private format: short keys, fast, no parameter choices to get wrong — and some ssh builds, including the one macOS ships, cannot load an Ed25519 key saved as PKCS#8. For TLS certificates and JWTs, ECDSA P-256 has the widest support among modern clients. Choose RSA when something old or strict requires it; NIST SP 800-57 considers 2048-bit RSA adequate through 2030 and recommends 3072 bits beyond that. A 4096-bit key can take a few seconds to generate in the browser.
- The private key has no passphrase. How do I add one?
- Save the OpenSSH format and run ssh-keygen -p -f yourkey to set a passphrase in place. For the PKCS#8 file, openssl pkcs8 -topk8 -v2 aes-256-cbc -in key.pem -out key.enc.pem writes an encrypted copy. After saving an SSH private key, restrict it with chmod 600, or ssh will refuse to use it.
- I need BEGIN RSA PRIVATE KEY, not BEGIN PRIVATE KEY.
- That is the older PKCS#1 container, which holds the same numbers. With OpenSSL 3, openssl rsa -in key.pem -traditional -out key.rsa.pem converts it. Most current software, including OpenSSH, accepts PKCS#8 directly, so check whether you really need the old form first.
- How can I check the key pair is sound?
- ssh-keygen -y -f yourkey prints the public key derived from an OpenSSH private key; it should equal the line this page shows. For PEM, openssl pkey -in key.pem -pubout prints the SPKI public key, which should match the PUBLIC KEY block byte for byte.
- Ed25519 gives an error. Why?
- Ed25519 arrived in WebCrypto later than RSA and ECDSA, and an out-of-date browser may not offer it. Current Chrome, Edge, Firefox and Safari do. Updating the browser fixes it; otherwise ECDSA P-256 is the closest alternative.
The open-source behind it
This tool is a self-contained implementation. openssl/openssl (Apache-2.0) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.
openssl/opensslAlso known as
- rsa key generator
- generate ssh key online
- ed25519 key generator
- pem key pair generator
- ecdsa key generator
- openssh public key