RSA Key Pair Generator
Generate a new RSA public/private key pair in standard PEM format, for use with JWT signing, SSH, or general cryptographic development.
Recommended Settings
Pro Tips
- •2048-bit keys are the current industry standard and are supported everywhere; 4096-bit keys offer more long-term security margin at the cost of slower generation and signing
- •The public key is safe to share freely - it's used to verify signatures made with the matching private key
- •The private key must be kept secret - anyone with it can create valid signatures on your behalf
- •Keys are exported in standard PEM format (SPKI for public, PKCS#8 for private), compatible with OpenSSL and most programming language crypto libraries
Most Popular
Most developers generate a 2048-bit key pair for general development and testing purposes
When to Use This Tool
Create an RSA key pair to sign and verify JSON Web Tokens (RS256).
Generate keys for local development environments and test certificates.
See a real RSA key pair to understand public and private key cryptography.
Quickly generate keys while prototyping a feature that needs public-key cryptography.
How It Works
Generate a new RSA key pair at your selected size using the Web Crypto API
Export the public key in SPKI format and the private key in PKCS#8 format, both as binary DER data
Base64-encode each key and wrap it in the standard PEM header and footer format
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Web Crypto API (SubtleCrypto.generateKey, RSA) for optimal performance on modern browsers.
Open Source
Built with verified, open-source libraries. Fully transparent.
Frequently Asked Questions
Is it safe to generate keys for production use here?
The generation itself uses the browser's standard, audited cryptographic implementation, but for production secrets, it's generally safer to generate keys directly on the server or system that will use them, minimizing exposure.
What format are the keys in?
Standard PEM format - SPKI for the public key and PKCS#8 for the private key - which is compatible with OpenSSL, most programming languages, and common cryptographic libraries.
What key size should I use?
2048 bits is the current widely accepted standard for most applications. Use 4096 bits if you need extra long-term security margin and can tolerate slower key generation and signature operations.
Is my data sent to a server?
No. Both keys are generated and exported entirely in your browser.
Can I use these keys for encryption instead of just signing?
This tool generates keys configured for RSA signing (RSASSA-PKCS1-v1_5). For encryption specifically, a key generated with the RSA-OAEP algorithm would be needed instead.