How to use
- Choose the key length: RSA 2048, 3072 or 4096. A new key pair is created right away, and Generate new key pair produces a different one each time.
- Pick the private key format (PKCS#8, PKCS#1 or JWK), then copy or download it.
- Pick the public key format (X.509 SPKI, PKCS#1 or JWK), then copy or download it. The public key can be handed to servers and other people.
- Keep the private key somewhere only you can reach, such as a password manager or a server’s secret store, and never commit it to a code repository.
Choosing a format
| Format | PEM header | Typical use |
|---|---|---|
| PKCS#8 private key | BEGIN PRIVATE KEY |
Read by default by OpenSSL 3, Java, Node.js, Go and Python cryptography. |
| PKCS#1 private key | BEGIN RSA PRIVATE KEY |
Older tools and RSA-only config files. |
| X.509 SPKI public key | BEGIN PUBLIC KEY |
The most common public key format. Includes the algorithm identifier. |
| PKCS#1 public key | BEGIN RSA PUBLIC KEY |
The shorter RSA-only form. |
| JWK | JSON | WebCrypto, JWT libraries, auth server settings. |
The three private key formats hold the same key in different wrappers. The PKCS#1 and PKCS#8 private keys made here pass openssl rsa -check, and both public key formats were verified to be byte-identical to the output of openssl rsa -pubout and -RSAPublicKey_out.
Key length and public exponent
| Length | Modulus | n inside the PKCS#1 public key |
|---|---|---|
| 2048 bits | 256 bytes | The top bit is set, so DER prepends 00, giving 257 bytes |
| 3072 bits | 384 bytes | Same rule |
| 4096 bits | 512 bytes | Same rule |
The public exponent e is fixed at 65537 (0x10001), the most widely used value, which appears as AQAB in a JWK. Weak settings such as RSA 1024 or e=3 are not offered. 2048 is the common minimum today, and for signatures that must stay valid for a long time consider 3072 or more.
Where it is used
- JWT RS256 signing: sign with the private key and verify with the public key. The JWK form drops straight into a JWKS setup, and you can inspect the tokens with the JWT Decoder.
- Testing server-to-server signing or encryption: download the PEM files and load them in
opensslor a language library. - SSH login keys belong in the SSH Key Generator instead, which produces the one-line
authorized_keyspublic key.
FAQ
Is the key sent to a server?
No. It is generated on your device with the browser’s WebCrypto (crypto.subtle.generateKey), and the PEM conversion happens in this page too. Nothing is transmitted or stored. Any copy of the private key you take from the screen is yours to protect.
Can I use it for a production key?
The key comes from the browser’s cryptographic random source, so it is technically sound, but core keys for a live service are better created on your own server or in an HSM or KMS and never shown on an outside screen. This tool suits development keys and integration tests.
What is the difference between PKCS#1 and PKCS#8?
PKCS#1 is a structure for RSA private keys only. PKCS#8 is a general wrapper that also carries an algorithm identifier, so EC and Ed25519 keys fit the same frame. The PKCS#1 structure sits unchanged inside PKCS#8.
Can I add a passphrase to the private key?
This tool creates unencrypted keys. After downloading you can encrypt one with a command like openssl pkcs8 -topk8 -in file -out newfile.
Why does 4096 take longer?
RSA key generation searches for two large primes, so longer keys take longer. It can take a few seconds depending on the device.
Related tools
- For key fingerprints and file integrity use the Hash Generator, and for message authentication codes the HMAC Generator.
- For symmetric encryption use AES Encrypt and Decrypt.
- To decode the Base64 inside a PEM, try the Base64 Encoder and Decoder.
Generated keys are processed only in your browser and never sent to a server.