RSA Key Pair Generator
Generate RSA key pairs (2048/3072/4096-bit) in your browser with Web Crypto, view PEM output, and encrypt/decrypt text. Private keys never leave your device.
Generate key pair
How it works
- Generate creates an RSA-OAEP key pair using
crypto.subtle.generateKey— a pure software operation, fully local. - The public key is exported as SubjectPublicKeyInfo (SPKI) PEM, the private key as PKCS#8 PEM.
- Encrypt signs with the public key; Decrypt reverses it with the private key, using RSA-OAEP with SHA-256.
- RSA-OAEP is limited to small payloads (roughly modulus length / 8 minus overhead — about 190 bytes at 2048 bits), so use it for keys and short secrets, not large files.
About RSA Key Pair Generator
RSA remains one of the most widely supported asymmetric algorithms: a public key encrypts or verifies, and the matching private key decrypts or signs. Generating a pair locally means the private key is created and exported on your machine — it is never transmitted, and you are in control of storing it (and ideally protecting it with a passphrase) yourself.
For exchanging secrets, RSA is almost always used to wrap a symmetric key (hybrid encryption) rather than encrypt data directly, because of the small payload limit. For new designs, ECDH or ECDSA with P-256/384 are more efficient and give equivalent strength with smaller keys — this tool exists for interop with existing systems, key stores, and OpenSSL-based workflows. Keep the private key private: anyone holding it can decrypt anything encrypted to your public key.