Key Pair Generator
Generate RSA and EC key pairs in your browser and export them as PEM (PKCS#8 / SPKI) or JWK.
Type
Modulus
Curve
Export as
Private key (PKCS#8 PEM)
Public key (SPKI PEM)
⚠️
Keys are generated in your browser with the Web Crypto API and never leave this page.
Algorithms
RSAWidely supported. Larger keys, slower. Generated here for signing (RSASSA-PKCS1-v1_5) — compatible with JWT RS256.EC (ECDSA)Elliptic-curve keys — much smaller and faster than RSA at equivalent strength. Curves map to JWT ES256 / ES384 / ES512.Sizes & strength
RSA 2048The common default — ~112-bit security. Fine for most uses.RSA 3072 / 4096Higher margin (~128-bit and up). Slower to generate and use.P-256~128-bit security in a tiny key — the usual EC choice (ES256).P-384 / P-521Stronger curves (ES384 / ES512) for higher assurance.Export formats
PKCS#8Standard -----BEGIN PRIVATE KEY----- PEM wrapping the private key. What WebCrypto and most libraries import.SPKIThe -----BEGIN PUBLIC KEY----- PEM for the public key — share this so others can verify or encrypt to you.JWKJSON Web Key — the JSON form used by JOSE / OAuth / OIDC. Private JWK includes the secret components; public JWK is safe to publish (e.g. in a JWKS).