RSA Key Pair Generator
Generate an RSA public and private key pair for encryption or signing, then export it as PEM or JWK.
runs entirely in your browserPublic PEM uses SPKI. Private PEM uses PKCS#8. JWK exposes the same generated key material as JSON.
Nothing is uploaded, saved, or added to a value history.
Generate the pair for one explicit RSA job
An RSA key pair has two linked halves. The public key can encrypt a small payload or verify a signature. The private key performs the matching decryption or signing operation and must remain secret. This generator creates both halves together with the browser's Web Crypto implementation.
Choose Encrypt / decrypt for RSA-OAEP. Choose Sign / verify for RSA-PSS, or select RSASSA-PKCS1-v1_5 when an existing system specifically requires that compatible signature format. RSA-PSS is the signing default for a new choice. Do not reuse one RSA pair across several schemes just because the underlying key numbers look compatible.
Start with 2048 bits, then follow the system you are configuring
The default modulus is 2048 bits, the practical minimum among the offered sizes. The 3072-bit and 4096-bit options produce larger keys and take longer to generate and operate. Pick a larger size when a protocol, organization, or retention policy requires it, not because the longer PEM block looks more secure.
SHA-256 is the default hash for OAEP, PSS, and PKCS#1 v1.5 signatures. SHA-384 and SHA-512 are available for contracts that name them. The public exponent is fixed at 65537, the interoperable choice used by Web Crypto examples and common RSA tooling.
Know which container your library expects
The public PEM is SubjectPublicKeyInfo, marked BEGIN PUBLIC KEY. The private PEM is unencrypted PKCS#8, marked BEGIN PRIVATE KEY. These are general key containers. They are not a certificate, an OpenSSH public key, a passphrase-protected private key, or the older PKCS#1 BEGIN RSA PRIVATE KEY form.
JWK represents the same pair as JSON. The public object contains the RSA modulus and exponent plus its intended key operation. The private object also contains private parameters such as d, p, and q, so changing from PEM to JWK does not make the private half safe to publish.
Export once and move the private half into protected storage
Generation and export happen inside this tab. Key values are not sent to a generation endpoint, placed in the URL, written to browser storage, or retained in a value history. Changing any setting clears the displayed pair before another one is generated.
Local generation removes this site's server from the path, but the private export is deliberately extractable and unencrypted so you can copy or download it. Clipboard managers, browser extensions, screen sharing, logs, source control, and chat can still expose it. Use a trusted device and move production material directly into the key-management workflow your system approves.
fair questions
- Does this RSA key generator send or save my private key?
- No. Web Crypto generates and exports the pair inside this tab. This tool does not put key values in requests, URLs, localStorage, sessionStorage, cookies, or a saved history. A browser extension, clipboard manager, screen capture, or downloaded file can still expose a private key after you export it.
- Should I choose RSA-OAEP, RSA-PSS, or RSASSA-PKCS1-v1_5?
- Use RSA-OAEP for encryption and decryption. Use RSA-PSS for a new signing choice. Use RSASSA-PKCS1-v1_5 only when an existing signature or JWT integration requires that format. Keep one key pair tied to one scheme rather than reusing it across these jobs.
- What kind of PEM files does this generator export?
- The public key is an SPKI BEGIN PUBLIC KEY block. The private key is an unencrypted PKCS#8 BEGIN PRIVATE KEY block. The tool does not produce PKCS#1 BEGIN RSA PRIVATE KEY, OpenSSH, PuTTY, certificates, certificate signing requests, or passphrase-encrypted PEM.
- Can I use these keys for SSH, TLS, or JWTs?
- Only when the receiving system accepts the exact algorithm and container shown here. SSH usually expects OpenSSH formatting, and TLS also needs a certificate workflow, neither of which this tool creates. A JWT library that accepts SPKI and PKCS#8 RSA signing keys may use a signing pair generated with its required hash and signature scheme.
- Should I use a 2048, 3072, or 4096-bit RSA key?
- Use the size required by your protocol or policy. This tool defaults to 2048 bits and does not offer deprecated 1024-bit generation. A 3072-bit or 4096-bit modulus increases generation time, file size, and operation cost, so choose it for a documented requirement rather than appearance.
- Is the private JWK safer to share than the private PEM?
- No. They are two containers for the same private key material. A private JWK exposes fields such as d, p, and q; the PKCS#8 PEM encodes equivalent private parameters. Share only the public export and treat either private format as a secret.
related tools
- Cryptographic Key GeneratorGenerate exact-length AES and HMAC keys, salts, IVs, nonces, or random secret bytes on your device.
- Password GeneratorGenerate strong random passwords or memorable passphrases on your device, with no signup or storage.
- JWT DecoderRead every claim, check the expiry clock, and verify HMAC signatures in your browser.