RSA Key Pair Generator
Generate RSA public and private key pairs in PEM format directly in your browser.
About the RSA Key Pair Generator
This tool generates RSA public and private key pairs entirely within your browser using the Web Crypto API — no keys are ever transmitted to or stored on any server. The public key is exported in SPKI format and the private key in PKCS#8 format, both wrapped in standard PEM encoding ready to use with OpenSSL, Node.js, Python, Java, and most other cryptographic toolchains.
Select a key size, click Generate Key Pair, and both keys appear immediately. Use the copy buttons to transfer them to your clipboard. For production use, always generate keys in a secure, controlled environment and protect your private key carefully.
What is RSA?
RSA (Rivest–Shamir–Adleman) is an asymmetric cryptographic algorithm published in 1977 and still in widespread use today. It relies on the mathematical difficulty of factoring the product of two large prime numbers. A key pair consists of a public key — which anyone can use to encrypt data or verify signatures — and a private key, which is kept secret and used to decrypt data or create signatures.
Choosing a Key Size
- 1024-bit — no longer considered secure against modern attack capabilities. Use only for legacy compatibility testing.
- 2048-bit — the current industry minimum for new deployments. Recommended for most applications including TLS certificates, SSH keys, and code signing.
- 4096-bit — provides a significantly higher security margin at the cost of slower key generation and larger signature sizes. Suitable for long-lived certificate authorities or high-value assets.
Key Formats Explained
- PEM — Privacy Enhanced Mail, a base64-encoded DER structure wrapped with
-----BEGIN ...-----/-----END ...-----headers. The most common format for storing and exchanging keys as text files. - SPKI (public key) — SubjectPublicKeyInfo, the standard ASN.1 structure for public keys defined in X.509 and used by the Web Crypto API.
- PKCS#8 (private key) — a standard format for private key information widely supported by OpenSSL and most programming language crypto libraries.
Related Tools
- SHA Hash GeneratorGenerate SHA-1, SHA-256, SHA-384 and SHA-512 hashes.Open tool
- MD5 Hash GeneratorGenerate MD5 hashes for checksums and legacy use cases.Open tool
- HMAC GeneratorGenerate HMAC signatures using SHA-256 or SHA-512.Open tool
- AES Encrypt / DecryptEncrypt and decrypt text using AES-256-CBC.Open tool