RSA Generator

Works fully offline

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.

Public Key
Private Key

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

2048-bit key pair for signing

Use case: Signing, Key size: 2048-bit
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
-----END PUBLIC KEY-----

How It Works

  1. Choose a use case — Signing (RSASSA-PKCS1-v1_5) or Encryption (RSA-OAEP).
  2. Choose a key size — 2048-bit or 4096-bit.
  3. Click Generate Key Pair — larger keys take a few extra seconds.
  4. Copy the public and private PEM blocks separately; keep the private key secret.

FAQ

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