RSA Key Pair Generator Online — 2048/3072/4096, PEM & JWK
Generate RSA key pairs (2048, 3072, or 4096 bits) online for OAEP encryption, PSS signing, or RS256 JWTs. Exports PKCS#8 private key + SPKI public key as PEM, JWK, or DER (hex/base64). 100% local — the Web Crypto API runs in your browser, private keys never leave the tab.
Last updated:
CommentsKey generation runs entirely in your browser using the native Web Crypto API. The private key is never transmitted — you can verify with your browser's DevTools Network panel.
Frequently Asked Questions
Is my private key uploaded anywhere?
No. Key generation runs entirely in your browser via the Web Crypto API's crypto.subtle.generateKey(). You can verify with your browser's DevTools Network panel — no request is made when you click Generate. The private key exists only in this tab's memory and is destroyed when you close it.
Which key size should I use?
2048 bits is the modern minimum and is still fine for most use cases. 3072 bits is what NIST recommends for anything expected to be secure past 2030. 4096 bits provides an extra safety margin but is roughly 5× slower for private-key operations. If you're targeting a device with limited CPU (embedded, mobile), stick with 2048; for long-lived server keys, 3072 is a sensible default.
What's the difference between RSA-OAEP, RSA-PSS, and RSASSA-PKCS1-v1_5?
RSA-OAEP is used for encryption (encrypting a symmetric key, for example). RSA-PSS is the modern padding for signatures with proper security proofs. RSASSA-PKCS1-v1_5 is the older signature padding still required for RS256 JWTs, TLS 1.2 signing, and many legacy protocols. Pick based on what your target system expects.
What is PKCS#8 and why does the private key start with 'BEGIN PRIVATE KEY'?
PKCS#8 is the IETF standard container format for asymmetric private keys, defined in RFC 5208 / 5958. OpenSSL's older '-----BEGIN RSA PRIVATE KEY-----' header is PKCS#1 (RSA-specific). Node, Go's crypto/x509, Java's KeyFactory, and modern Python cryptography all prefer PKCS#8 because it's algorithm-agnostic. If a legacy tool needs PKCS#1, run `openssl rsa -in key.pem -traditional` to convert.
Can I use this key for a JWT?
Yes. For RS256 JWTs, pick RSASSA-PKCS1-v1_5 with SHA-256. For PS256 JWTs, pick RSA-PSS with SHA-256. Copy the private key PEM into your JWT library (jsonwebtoken, PyJWT, jose, etc.) and it'll sign against it directly. The public key JWK from this tool can be published as a JWKS endpoint for verifiers.
Should I generate keys in the browser for production use?
For personal / development use, yes — this tool is convenient and safe. For production keys that protect real assets, generate them inside a Hardware Security Module (HSM) or Cloud KMS (AWS KMS, GCP KMS, Azure Key Vault) so the private key never exists on any general-purpose computer.
Related Tools
JWT Decoder
Decode JSON Web Tokens (JWT) to inspect the header, payload, and signature. Runs entirely in your browser — tokens are never sent to any server.
AES Encrypt / Decrypt
Encrypt and decrypt text with AES (128 / 192 / 256, GCM authenticated or CBC legacy) using a password. PBKDF2 key derivation with 200,000 iterations. 100% local — the Web Crypto API runs entirely in your browser.
Public Key Extractor
Paste an RSA or EC private key (PEM PKCS#8 or JWK) and instantly extract the matching public key in PEM (SPKI), JWK, or DER format. Perfect for publishing a JWKS endpoint, verifying a token against a private-key-only backup, or distributing a public key to peers. 100% local — the private key never leaves your browser.
RSA Encrypt / Decrypt
Encrypt text with an RSA public key or decrypt ciphertext with the private key, using RSA-OAEP (SHA-256/384/512). Accepts PEM (PKCS#8 / SPKI) or JWK. 100% local — keys and plaintext never leave your browser tab.
ECDSA Sign / Verify
Sign or verify messages with ECDSA (P-256, P-384, P-521) using PEM or JWK keys. Outputs both JOSE / P1363 (JWT-compatible) and DER (OpenSSL-compatible) signatures. 100% local via the Web Crypto API.
ECDSA Key Generator
Generate elliptic-curve key pairs (P-256, P-384, P-521) for ECDSA signatures or ECDH key agreement. Exports PKCS#8 / SPKI PEM, JWK, and DER (hex/base64). Perfect for ES256/ES384/ES512 JWTs. 100% local via the Web Crypto API — the private key never leaves your browser.