Runs 100% in your browser — nothing is uploaded
Crypto, Hashing & Security

RSA Key Pair Generator

Generate RSA public/private key pairs (1024/2048/4096-bit) as PEM, entirely in your browser.

RSA Key Pair Generator
Client-side

About this tool

The RSA Key Pair Generator creates a fresh RSA public/private key pair using the browser's native Web Crypto API (RSASSA-PKCS1-v1_5 with SHA-256), then exports both keys as standard PEM-encoded text — PKCS8 for the private key, SPKI for the public key. No external library is used: key generation, export, and Base64/PEM formatting all happen with browser-native primitives, the same ones used by TLS.

Choose a modulus length of 1024, 2048, or 4096 bits. 2048-bit is the current baseline for real-world use; 1024-bit is fast but considered too weak for production and is included mainly for quick testing; 4096-bit offers a larger security margin at the cost of noticeably slower generation — expect several seconds in some browsers, during which a loading indicator is shown.

Each generated key includes its own Copy and Download button (as a .pem file) so you can drop the private key into an SSH config, a JWT RS256 signing setup, a TLS certificate signing request, or any tool expecting standard PKCS8/SPKI PEM. Because everything runs client-side, the private key is never transmitted anywhere.

This tool is well suited for local development, testing RS256 JWT flows, generating throwaway keys for a lab environment, or learning how RSA key material is structured. For production TLS certificates or long-lived signing keys, use a dedicated, audited key-management workflow.

FAQ

Is it safe to generate RSA keys in a browser tab?
The cryptographic generation uses the browser's native Web Crypto implementation, which is sound. However, no online tool is appropriate for generating long-lived production keys. Use this for development, testing, and learning; use an offline, audited workflow for production key material.
Why is 4096-bit generation so much slower than 1024 or 2048?
RSA key generation involves finding large prime numbers, and the cost of primality testing grows steeply with key size. 4096-bit keys can take several seconds depending on your browser and CPU.
What is the difference between the PKCS8 and SPKI formats?
PKCS8 is the standard container format for a private key. SPKI is the standard container format for a public key. Both are exported here, Base64-encoded and wrapped in PEM headers, the same format used by OpenSSL and most TLS/JWT libraries.
Should I use 1024-bit RSA keys?
No, not for anything security-sensitive. 1024-bit RSA is considered breakable by well-resourced attackers and is deprecated by essentially all standards bodies.
Can I use the generated keys for JWT RS256 signing?
Yes — export the private key PEM and use it to sign RS256 JWTs, and distribute the public key PEM to verifiers. This is a common local-development pattern for testing RS256-based authentication flows.