LocalExcelTool
Get started

RSA Key Generator

Generate RSA-OAEP 2048/3072/4096-bit key pairs locally in your browser.

Runs in your browserNo account neededFree

What is RSA Key Generator

This RSA key generator creates RSA-OAEP public/private key pairs with the browser's Web Crypto API. Choose 2048, 3072 or 4096-bit keys; output is standard PEM. Keys are generated locally — the private key is never uploaded anywhere.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Generated in the tab, and that has consequences

The pair is produced by crypto.subtle.generateKey with RSA-OAEP and SHA-256, public exponent 65537 — the standard interoperable choice. The private key exists only in this tab's memory. Nothing is stored, nothing is recoverable, and a refresh destroys it. Copy it before doing anything else.

That ephemerality is a feature for a demo and a hazard for real use. A production key pair should be generated where it will live — an HSM, a KMS, or at minimum a machine with disk encryption — because a lost private key cannot be regenerated, only replaced along with everything that trusts it.

RSA-OAEP encrypts; it does not sign

The algorithm identifier determines the permitted operations. OAEP is a padding scheme for encryption and key transport; asking the same key to sign produces an error in Web Crypto. Signing needs RSASSA-PKCS1-v1_5 or RSA-PSS, which are separate algorithm names and separate key usages.

This trips people up because the key material looks identical. A key imported as 'RSA-OAEP' will refuse sign operations, and the error message usually mentions the algorithm rather than the usage — so the fix is to regenerate with the intended algorithm, not to retry.

Reading the exported formats

The export is PEM-wrapped: PKCS#8 for the private key, SubjectPublicKeyInfo (SPKI) for the public key, both standard and accepted by OpenSSL, Node and every cloud KMS import flow. The base64 body is the DER structure, wrapped at 64 characters.

Key size is the practical parameter: 2048 bits is the minimum still accepted everywhere, 3072 and 4096 are safer and slower. The real cost of RSA is that encryption is limited to a payload smaller than the modulus minus padding overhead — roughly 190 bytes at 2048 bits for OAEP-SHA256. Anything longer must be encrypted with a symmetric key that RSA then wraps, which is what every real protocol does.

How to use it

  1. 1.Choose a key size
  2. 2.Click Run
  3. 3.Save the public and private keys separately

How RSA Key Generator works under the hood

Encoding tools convert between representations of the same bytes: Base64, percent-encoding, hex, HTML entities, Unicode escapes. A correct encoder is reversible; a lossy one silently changes the data.

  1. 1

    Get the exact bytes

    Text is encoded to UTF-8 bytes with TextEncoder first; binary input is read as an ArrayBuffer. Encoding the wrong byte sequence is the most common cause of a wrong result.

  2. 2

    Apply the encoding rule

    Each format has an exact specification: Base64 uses a 64-symbol alphabet with padding, percent-encoding escapes reserved characters as UTF-8 bytes.

  3. 3

    Decode back to verify

    Round-tripping the output back to the input is the only honest proof that an encoder is correct. The tool keeps the reverse path available on the same page.

  4. Processing pipeline

Base64 is not encryption

Base64 increases size by about a third and hides nothing: anyone can decode it. It exists to carry binary data through text-only channels such as JSON, email headers and data URLs. If you need confidentiality, use encryption with a key, not an encoding.

Where encoders break

Percent-encoding applied twice turns %20 into %2520; Base64 without padding fails strict decoders; UTF-16 input decoded as UTF-8 produces replacement characters that cannot be recovered. When output looks wrong, check the byte sequence before checking the tool.

Verify it yourself

Encoders are pure functions over bytes. Decode the output again and you should get the input back exactly.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

Is the private key safe?

Yes. It is generated in your browser and never sent anywhere — but it disappears when you close the tab, so copy it immediately.

Which key size should I pick?

2048-bit for general use; 3072 or 4096-bit for long-lived or high-security requirements.

What this kind of conversion cannot keep

Encoding and hashing run through the browser's Web Crypto API or a pure-JavaScript implementation. The output is deterministic: the same input always produces the same digest, so you can verify a result against any other tool.

More in Encoding