RSA Generator
Pick a key size and a use case, and get a fresh RSA public/private key pair in standard PEM format — generated locally using the Web Crypto API, never sent anywhere.
Overview
RSA is an asymmetric algorithm: a public key that can be shared freely, and a private key that must stay secret, mathematically linked so that only the private key can decrypt what the public key encrypted (or only the private key can produce a signature the public key verifies). This tool generates that pair using the browser's native Web Crypto API — the same cryptographic implementation browsers use for WebAuthn and TLS — rather than a JavaScript reimplementation, and exports both keys in the standard PEM format most tools and libraries expect.
Choose Signing if you need a key pair for RSASSA-PKCS1-v1_5 signatures (common for JWTs using RS256, or code/document signing). Choose Encryption for RSA-OAEP, used to encrypt small payloads like a symmetric key. A larger key size is slower to generate and slightly slower in use, but harder to attack — 2048-bit is the current common minimum; 4096-bit adds margin at the cost of speed.
Examples & Sample Data
2048-bit key pair for signing
Use case: Signing, Key size: 2048-bit
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... -----END PUBLIC KEY-----
How It Works
- Choose a use case — Signing (RSASSA-PKCS1-v1_5) or Encryption (RSA-OAEP).
- Choose a key size — 2048-bit or 4096-bit.
- Click Generate Key Pair — larger keys take a few extra seconds.
- Copy the public and private PEM blocks separately; keep the private key secret.
Common Use Cases
Signing tokens in development
Create a signing key pair for RS256 JSON Web Tokens or webhook signatures on a test environment without installing OpenSSL.
Testing encryption code
Generate an RSA-OAEP pair to check that your application encrypts with the public key and decrypts with the private one.
Frequently Asked Questions
No. Key generation and PEM export both happen entirely in your browser using the Web Crypto API — the private key is never transmitted.
The cryptographic generation itself uses the same secure implementation as the rest of the browser, but treat any private key generated here as sensitive from the moment it appears on screen — avoid leaving it visible, and prefer generating production keys in an environment you control end to end (an HSM, or a CLI on an air-gapped machine) for anything high-stakes.
Signing (RSASSA-PKCS1-v1_5) if the key pair will verify signatures — for example an RS256-signed JWT. Encryption (RSA-OAEP) if it will encrypt data directly, such as wrapping a symmetric key. The two use different padding schemes and Web Crypto doesn't allow one key pair to do both.
RSA key generation involves finding large random prime numbers, and the search gets slower as the key size grows. It's a one-time cost — using the key afterward isn't meaningfully slower.
Related Tools
Explore more high-performance utilities.
More in Developer Tools
- SQL Formatter
- Timestamp Converter
- URL Encoder/Decoder
- UUID Generator
- Webhook / Request Bin Tester
- XML to JSON Converter
- Base64 Encoder/Decoder
- Bcrypt Generator