An RSA key generator creates a matched pair of keys in which the public key encrypts and the mathematically related private key decrypts, and this page builds a fresh 2048- or 3072-bit pair with RSA-OAEP and SHA-256 inside your browser.
That definition hides most of what a beginner needs to know. RSA is asymmetric encryption, the two halves have completely different jobs, and the parameters you pick must match what the system on the other end expects. This guide walks through the RSA Key Generator in order: what it produces, where each output belongs, and how to prove a new pair works before trusting it with real data.
Two facts shape everything below. The key pair is generated locally, with Web Crypto creating the keys in this tab, so no key bytes are sent to the application server. And the output is deliberately random: generating twice with identical settings produces two different pairs, which means there is no "correct" key to compare against and no golden value to match. Correctness here comes from testing behavior, not from matching a fixed string.

What the generator actually produces
The page asks the platform's Web Cryptography implementation to generate two large primes and a public exponent of 65537, then wraps the result in the two envelopes most systems expect: a public key as SubjectPublicKeyInfo (SPKI) PEM and a private key as unencrypted PKCS#8 PEM. Both are plain-text PEM, Base64-wrapped at 64 columns per RFC 7468, so you can paste the public key into a configuration field or onboarding form without dealing with binary blobs. Transfer the private PEM directly into protected storage, and never place it in a support ticket.
You can recognize the two outputs by their headers. The public key starts with -----BEGIN PUBLIC KEY----- and carries an ASN.1 SPKI structure; the private key starts with -----BEGIN PRIVATE KEY----- and carries PKCS#8 key material. Those headers are more than labels. SPKI is what modern software usually means by "RSA public key in PEM," and PKCS#8 is the generic private-key envelope that avoids older type-specific formats. If a system asks for PKCS#1 or OpenSSH, that is a different request and this page does not produce it.
The private PEM arrives without a password wrapper. Web Crypto exports the PKCS#8 bytes as they are, so the text you copy is the complete private key: anyone who obtains it can decrypt compatible ciphertext. That is the trade for a browser-based tool. Nothing is uploaded, but protecting the key becomes your responsibility the moment you copy it.
Choosing between 2048 and 3072 bits
Only the modulus size changes between the two options; both use exponent 65537, RSA-OAEP, and SHA-256. The larger modulus buys a wider security margin and costs you in generation time and per-operation speed, so the choice is a balance between headroom and performance.
| Aspect | 2048-bit modulus | 3072-bit modulus |
|---|---|---|
| Compatibility | Broadly interoperable with existing systems | Confirm the receiving system accepts a 3072-bit modulus |
| Security margin | Standard size offered | Larger margin than 2048 |
| Speed | Faster key generation and encryption operations | Slower generation and operations |
| Public exponent | 65537 | 65537 |
| Typical fit | Day-to-day use where the widest compatibility matters | Environments that can accept slower operations for a larger margin |
There is no 1024-bit option and no way to change the public exponent; those fixed choices exist to reduce the ways a key pair can be misconfigured. If your target application insists on a different exponent, a different hash, or the older PKCS#1 v1.5 encryption scheme, this page cannot satisfy it.
Generating your first key pair
Work through these steps in order. The order matters: checking the protocol first can save you a key pair you never use, and testing last can save you from deploying a pair that imports but does not interoperate. Use a trusted, patched device, since extensions, malware, clipboard managers, and screenshots sit outside the generator's guarantees.
- Confirm the target protocol. The application must require RSA-OAEP with SHA-256, public exponent 65537, and SPKI/PKCS#8 PEM envelopes. Check its documentation or configuration before generating anything.
- Choose a size and generate. Select 2048 or 3072 bits and run the generator. Generation is asynchronous because two large primes have to be found first, so give the 3072-bit option extra time. The page tracks each job so an older request cannot overwrite newer settings.
- Copy the public key to the consumer. Hand over only the -----BEGIN PUBLIC KEY----- block. It is safe to distribute, since it only lets the recipient encrypt for you.
- Transfer the private key directly into protected storage. Paste the -----BEGIN PRIVATE KEY----- block into a secret manager or encrypted keystore with strict access control and tested backups. Keep it out of source control, tickets, chat, analytics, browser sync, and ordinary notes.
- Run an end-to-end encryption test. Encrypt a known message with the public key and decrypt it with the private key using the exact application protocol, then confirm the original text comes back exactly. A key that imports cleanly can still fail this step.
- Close the tab and clear clipboard history. Once the private key is stored and the round trip passes, the outputs live only in page memory until you navigate away or generate a replacement.
Sending the public key and protecting the private key
The public key travels; the private key stays. The SPKI PEM is meant for systems that encrypt data on your behalf, and distributing it adds no risk to the secrets you send, because decryption still requires the private half. Copy it into the consumer's configuration exactly as-is, keeping the header and footer lines intact.
The private key is the whole secret. Because the output is not password-encrypted, treat every intermediate location as a possible exposure: a chat message, a build log, a synced notes file, a screenshot. Store it in a secret manager or encrypted keystore with strict access control and backups, and limit who can read it.
If the private PEM leaks, rotate immediately. Generate a fresh pair, replace the public key wherever it was distributed, and move the new private key into protected storage. Deleting the old copy is no substitute for rotation, because it cannot be un-copied.
Why an imported PEM is not proof that the pair works
RSA-OAEP parameters must match on both sides of the exchange, and the failure is quiet. A PEM can import successfully into the receiving library and still produce unusable ciphertext, because the other side may default to SHA-1, or may use different OAEP label and mask-generation settings. Your keys declare SHA-256, and that declaration only helps if the peer is configured the same way.
That is why the last step is a real round trip rather than an import check. Encrypt a known UTF-8 message with the public key, decrypt with the private key, and assert exact recovery, plus confirm the imported algorithm reports the modulus length you selected. The tool's own verification follows that pattern: it locks eight external parameter invariants, exports both envelopes, imports the generated SPKI and PKCS#8 back into Web Crypto, encrypts a known message with the public key, and asserts exact recovery with the private key. It cannot compare against a fixed golden private key, because secure generation must be random.
Run that test with the exact protocol your application uses, including its framing and headers. A round trip inside a standalone script proves the key pair is sound; it does not prove your application's handshake matches.
How much data can one RSA key encrypt?
RSA encrypts only limited-size messages, and the ceiling is defined in RFC 8017: the largest plaintext is k − 2·hLen − 2 octets, where k is the modulus length in octets and hLen is the hash length in octets. With SHA-256 the hash length is 32 octets, so for a 2048-bit key (256 octets), the limit is 256 − 2 × 32 − 2 = 190 bytes.
That is why applications normally encrypt a random symmetric key with RSA-OAEP and then protect the actual payload with authenticated symmetric encryption. The RSA key handles key exchange; a modern symmetric cipher handles the data. Do not split a large file into raw RSA blocks, and do not expect a single RSA key to encrypt a photo. This page generates keys and intentionally does not invent a hybrid file format, so the surrounding protocol stays yours to define.
What this generator deliberately does not do
The scope is narrow on purpose. This is not a certificate authority: it creates no X.509 certificates, no certificate signing requests, no RSA-PSS signatures, no SSH keys, and no JSON Web Keys. It also does not offer 1024-bit keys, custom public exponents, raw RSA, the older PKCS#1 v1.5 encryption scheme, or SHA-1, because fixed, safer choices reduce the number of ways to misconfigure a key pair.
For production identity or TLS, prefer the key-generation workflow provided by the owning platform or a hardware security module; a browser tab is a testing and convenience tool, not a key custody system. If you convert formats later, preserve the algorithm parameters and keep the private key secret while doing so.
One boundary is worth keeping in mind: the outputs live in component memory only until you navigate away or generate a replacement. Extensions, malware, clipboard managers, and screenshots operate outside that boundary, so treat the clipboard as a place where a private key briefly exists.
The whole flow reduces to one line: confirm the protocol, generate a single pair at the size your application supports, copy the public key out, transfer the private key directly into protected storage, and prove it with an end-to-end round trip. If you want to weigh this browser workflow against command-line tools before committing, read the guide on command line versus online RSA generation. If you plan to generate keys from an application rather than by hand, the local PEM output approach covers that route.