ECDSA Key Pair Generator — P-256 / P-384 / P-521, PEM & JWK
Generate elliptic-curve key pairs (P-256, P-384, P-521) for ECDSA signatures or ECDH key agreement. Exports PKCS#8 / SPKI PEM, JWK, and DER (hex/base64). Perfect for ES256/ES384/ES512 JWTs. 100% local via the Web Crypto API — the private key never leaves your browser.
Last updated:
CommentsKey generation uses the native Web Crypto API entirely in your browser. Elliptic-curve keys are dramatically smaller than RSA at equivalent strength (256-bit EC ≈ 3072-bit RSA).
Frequently Asked Questions
Which curve should I pick?
P-256 (also called secp256r1 or prime256v1) is the default — fast, widely supported, and provides 128-bit security. Use it unless you have a specific reason to go higher. P-384 gives 192-bit security and is required by some government profiles (Suite B TOP SECRET). P-521 is rarely necessary and has slightly awkward performance because 521 bits doesn't align to word boundaries.
What's the difference between ECDSA and ECDH?
Same key material, different math. ECDSA uses the key pair to produce and verify signatures. ECDH uses two key pairs (yours + the peer's) to derive a shared secret without ever transmitting it — that shared secret is then usually fed into a KDF (HKDF, PBKDF2) and used as a symmetric key. If you need signing, pick ECDSA; if you need key agreement / hybrid encryption, pick ECDH.
How do these curves map to JWT algorithms?
P-256 → ES256, P-384 → ES384, P-521 → ES512. Most JWT libraries detect this automatically from the JWK 'crv' field. Note that ES256K (secp256k1, Bitcoin's curve) is NOT included here — the Web Crypto API doesn't expose it. If you need secp256k1, use a dedicated library like noble-curves.
Why are EC keys so much shorter than RSA keys?
Because elliptic-curve cryptography reaches equivalent security with far smaller keys. A 256-bit EC key gives roughly the same security as a 3072-bit RSA key. Smaller keys mean smaller signatures, less bandwidth, faster handshakes — which is why TLS, SSH, and modern JWTs increasingly default to EC.
Is my private key sent anywhere?
No. crypto.subtle.generateKey() runs entirely in your browser. You can verify with DevTools Network panel — Generate produces no network traffic. Once you close the tab, the private key is gone.
Related Tools
JWT Decoder
Decode JSON Web Tokens (JWT) to inspect the header, payload, and signature. Runs entirely in your browser — tokens are never sent to any server.
AES Encrypt / Decrypt
Encrypt and decrypt text with AES (128 / 192 / 256, GCM authenticated or CBC legacy) using a password. PBKDF2 key derivation with 200,000 iterations. 100% local — the Web Crypto API runs entirely in your browser.
RSA Key Generator
Generate RSA key pairs (2048, 3072, or 4096 bits) online for OAEP encryption, PSS signing, or RS256 JWTs. Exports PKCS#8 private key + SPKI public key as PEM, JWK, or DER (hex/base64). 100% local — the Web Crypto API runs in your browser, private keys never leave the tab.
Public Key Extractor
Paste an RSA or EC private key (PEM PKCS#8 or JWK) and instantly extract the matching public key in PEM (SPKI), JWK, or DER format. Perfect for publishing a JWKS endpoint, verifying a token against a private-key-only backup, or distributing a public key to peers. 100% local — the private key never leaves your browser.
RSA Encrypt / Decrypt
Encrypt text with an RSA public key or decrypt ciphertext with the private key, using RSA-OAEP (SHA-256/384/512). Accepts PEM (PKCS#8 / SPKI) or JWK. 100% local — keys and plaintext never leave your browser tab.
ECDSA Sign / Verify
Sign or verify messages with ECDSA (P-256, P-384, P-521) using PEM or JWK keys. Outputs both JOSE / P1363 (JWT-compatible) and DER (OpenSSL-compatible) signatures. 100% local via the Web Crypto API.