RSA Key Pair Generator

Runs in browser

Generate RSA key pairs in-browser. 1024, 2048 or 4096 bits. PEM format.

Generate RSA public and private key pairs in your browser. Choose 1024, 2048, or 4096-bit key size. Keys are exported in PEM format and never sent to any server.

RSA Key Pair Generator tool

🔒 Keys are generated entirely in your browser using the Web Crypto API. They are never sent to any server. For production use, generate keys on your own machine.

Key Type

Key Size

Click Generate Keys to create a RSA-2048 key pair.

🔒 Runs in your browser · No uploads · Your data never leaves your device

How to use

  1. Choose key size

    Select 1024, 2048, or 4096 bits. 2048-bit is recommended for most uses. 4096-bit provides extra security at the cost of generation time.

  2. Generate keys

    Click Generate Keys. The private and public keys appear in PEM format below.

  3. Copy or download

    Use Copy or the .pem button to save each key separately.

Common use cases

  • Generating test keys for JWT signingCreate an RS256 key pair for signing JWTs in development — use the private key to sign and the public key to verify.
  • Preparing keys for SSH or TLS configurationGenerate a 4096-bit RSA key pair as a starting point before converting to the format required by your server.

Examples

  • 2048-bit RSA key pair

    Generate a standard 2048-bit key pair.

    Output
    -----BEGIN PRIVATE KEY-----
    MIIEvQIBADANBgkq...
    -----END PRIVATE KEY-----

Frequently asked questions

Are the keys generated securely?
Yes. The Web Crypto API uses the OS cryptographically secure pseudo-random number generator (CSPRNG). Keys are never transmitted to any server.
What is PKCS#8 format?
PKCS#8 is the standard format for private keys. The private key file starts with -----BEGIN PRIVATE KEY-----. The public key is in SPKI format, starting with -----BEGIN PUBLIC KEY-----.
Can I use these keys for SSH?
Not directly. SSH uses its own key format. Use ssh-keygen on your machine for SSH keys.

Key concepts

PEM format
A Base64-encoded certificate or key format delimited by '-----BEGIN...' and '-----END...' headers — the standard for storing RSA keys.
Asymmetric encryption
A cryptographic system using a key pair: data encrypted with the public key can only be decrypted with the private key, and vice versa.

You might find these useful too.

More hashing tools