RSA Key Pair Generator

Online RSA key pair generator built on the browser's native Web Crypto API. Supports 1024, 2048 and 4096-bit keys and produces public and private keys in PEM format, computed entirely locally with nothing uploaded.

FreeOnline Tool
Loading…

How to Use

  1. Choose a key size: 2048-bit (recommended, balancing security and speed), 1024-bit (quick testing only) or 4096-bit (for higher security requirements)
  2. Click generate and the browser computes an RSA key pair locally
  3. The public and private keys are shown as PEM-format text, ready to copy

Features

  • Generates RSA-OAEP key pairs through the browser's native Web Crypto API (crypto.subtle.generateKey), with no third-party libraries involved
  • Three key sizes available: 1024-bit for quick tests, 2048-bit recommended, and 4096-bit where security demands are high
  • Both keys are exported in standard PEM format for direct use in other systems and tools
  • Key generation runs entirely in your browser, so the private key never leaves your device

Use Cases

Generating test keys during development
Produce a test key pair while debugging RSA-based functionality without installing OpenSSL or other command-line tooling.
Learning asymmetric cryptography
Generate real key pairs to understand how public and private keys relate to each other and what PEM format looks like.
Encrypting a small piece of data
Create a usable key pair quickly when you need to encrypt a short piece of sensitive text, such as a temporary password, with an RSA-OAEP public key.
Comparing key sizes
Generate 1024, 2048 and 4096-bit keys in turn to see how key size affects generation time and the length of the key text.

FAQ

Which key size should I choose?
2048-bit is the current recommended baseline, balancing security against computation time and suiting nearly every use case. 1024-bit is no longer recommended for anything security-sensitive and is only appropriate for quick functional tests. 4096-bit is stronger but noticeably slower to generate and use, so reserve it for high-assurance scenarios.
Is the private key safe, and is it uploaded or stored anywhere?
Generation happens entirely in your browser, and the private key is never uploaded to a server or stored by this tool. Note that the generated private key is displayed on the page, so avoid generating one in public or sharing screenshots that include it.
What can the generated keys be used for?
The tool produces RSA-OAEP key pairs, which are intended for encryption and decryption. If you need keys for digital signatures such as RSASSA-PKCS1-v1_5, generate them with a method that supports that algorithm, as the keys here are specific to encryption.
Why does generating a 4096-bit key take so long?
Larger RSA keys require more expensive large-prime computations, so a 4096-bit key takes noticeably longer than 1024 or 2048-bit. This is expected, so let the browser finish its work.