RSA & EC Key Pair Generator
Generate RSA or elliptic-curve key pairs in PEM and JWK format.
Key type
Pick a key type and generate. Everything happens in your browser — the private key is never transmitted.
About the RSA & EC Key Pair Generator
Generate an RSA or elliptic-curve key pair in your browser and export it as PEM or JWK. Pairs directly with the JWT tool: generate a key here, sign tokens with the private half, and verify them there with the public half.
How to use it
- 1 Choose a key type — RSA 2048 is the safe default, EC P-256 the modern one.
- 2 Click Generate; the pair is created locally with the Web Crypto API.
- 3 Copy the public key for your verifier and the private key for your signer.
- 4 Store the private key somewhere secret — it is never recoverable from the public one.
What it does
- RSA 2048 and 4096, ECDSA on P-256, P-384 and P-521
- Export as PEM (SPKI and PKCS#8) and as JWK
- Shows the matching JOSE algorithm — RS256, ES256 and so on
- Generated with the Web Crypto API in your browser
- Nothing transmitted: the private key exists only in this tab
Frequently asked questions
Is it safe to generate a private key in a browser?
The generation itself uses the same vetted implementation your browser uses for TLS, and nothing is transmitted. The real risks are environmental: a compromised machine, a malicious extension, or pasting the key somewhere careless. For production keys protecting real systems, generate on the target machine with ssh-keygen or openssl. For development, testing and JWT experiments, this is fine.
Should I choose RSA or EC?
EC unless something forces RSA. A P-256 key gives comparable security to RSA 3072 at a fraction of the size, and signs considerably faster. RSA is still the wider-supported option in older libraries and some enterprise systems, which is the usual reason to pick it.
What is the difference between PEM and JWK?
The same key in two encodings. PEM is the base64 block between BEGIN/END lines that OpenSSL and most servers expect. JWK is a JSON object used by OAuth and OIDC infrastructure, and is what a JWKS endpoint publishes. Use whichever your library takes.
Which key do I give out?
Only the public key. It goes into your verifier, your JWKS endpoint, or the other party's configuration. The private key signs, and must stay secret — anyone holding it can forge signatures that verify against your public key.
Can I recover a lost private key from the public one?
No. That is the entire basis of public-key cryptography. If the private key is lost, generate a new pair and rotate the public key everywhere it is configured.