Skip to content

RSA Key Pair Generator

Generate a new RSA public/private key pair in standard PEM format, for use with JWT signing, SSH, or general cryptographic development.

Category: security
Use Case: Generating Keys for JWT Signing, Development & Testing Certificates, Learning Public-Key Cryptography
Privacy: 100% browser-based

Recommended Settings

Pro Tips

  • 2048-bit keys are the current industry standard and are supported everywhere; 4096-bit keys offer more long-term security margin at the cost of slower generation and signing
  • The public key is safe to share freely - it's used to verify signatures made with the matching private key
  • The private key must be kept secret - anyone with it can create valid signatures on your behalf
  • Keys are exported in standard PEM format (SPKI for public, PKCS#8 for private), compatible with OpenSSL and most programming language crypto libraries

Most Popular

Most developers generate a 2048-bit key pair for general development and testing purposes

When to Use This Tool

Generating Keys for JWT Signing

Create an RSA key pair to sign and verify JSON Web Tokens (RS256).

Development & Testing Certificates

Generate keys for local development environments and test certificates.

Learning Public-Key Cryptography

See a real RSA key pair to understand public and private key cryptography.

Prototyping Encryption or Signing Features

Quickly generate keys while prototyping a feature that needs public-key cryptography.

How It Works

1

Generate a new RSA key pair at your selected size using the Web Crypto API

2

Export the public key in SPKI format and the private key in PKCS#8 format, both as binary DER data

3

Base64-encode each key and wrap it in the standard PEM header and footer format

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Web Crypto API (SubtleCrypto.generateKey, RSA) for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

Is it safe to generate keys for production use here?

The generation itself uses the browser's standard, audited cryptographic implementation, but for production secrets, it's generally safer to generate keys directly on the server or system that will use them, minimizing exposure.

What format are the keys in?

Standard PEM format - SPKI for the public key and PKCS#8 for the private key - which is compatible with OpenSSL, most programming languages, and common cryptographic libraries.

What key size should I use?

2048 bits is the current widely accepted standard for most applications. Use 4096 bits if you need extra long-term security margin and can tolerate slower key generation and signature operations.

Is my data sent to a server?

No. Both keys are generated and exported entirely in your browser.

Can I use these keys for encryption instead of just signing?

This tool generates keys configured for RSA signing (RSASSA-PKCS1-v1_5). For encryption specifically, a key generated with the RSA-OAEP algorithm would be needed instead.