# RSA Key Pair Generator

> 2048 to 4096-bit RSA keys as PEM, PKCS#1, OpenSSH or JWK. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/rsa-key-generator

**Category:** [Security](https://toffeekit.com/category/security) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/rsa-key-generator

**Also useful for:** rsa key, key pair, public key, private key, pem, ssh key, openssh, jwk, rs256

## What you can do

- **Make an SSH key** — id_rsa and id_rsa.pub ready for GitHub or a server. ([open with this preset](https://toffeekit.com/tools/rsa-key-generator?preset=ssh))
- **Sign JWTs with RS256** — PKCS#8 and SPKI PEM files most JWT libraries read. ([open with this preset](https://toffeekit.com/tools/rsa-key-generator?preset=jwt))

## How it works

1. Choose a Key size: 2048, 3072 or 4096 bits.
2. Pick a Format: PEM, PKCS#1, OpenSSH or JWK.
3. For OpenSSH, set the Comment, usually your email or machine name.
4. Copy or download the private and public keys, and click New key pair for another.

## FAQ

### What key size should I choose?

2048 bits is the minimum accepted today and fine for most uses. 3072 bits matches 128-bit security, and 4096 bits is a common choice for long-lived SSH keys at the cost of slower signing.

### What is the difference between PKCS#8 and PKCS#1?

Both hold the same key. PKCS#8 (BEGIN PRIVATE KEY) is the modern, algorithm-neutral format; PKCS#1 (BEGIN RSA PRIVATE KEY) is the older RSA-only format some legacy tools still expect.

### How do I use the key for SSH?

Choose OpenSSH, save id_rsa and id_rsa.pub into your ~/.ssh folder and run chmod 600 on id_rsa. Paste the .pub line into GitHub, GitLab or a server's authorized_keys file.

### Does the private key have a passphrase?

No. To add one, run ssh-keygen -p -f id_rsa for OpenSSH keys, or openssl pkey -in private-key.pem -aes256 -out encrypted.pem for PEM keys.

### Can I use these keys to sign JWTs?

Yes. The PEM private key works for RS256, RS384 and RS512 in most JWT libraries, and the JWK format gives a ready-made entry for a JWKS endpoint.

### Is RSA Key Pair Generator free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

RSA Key Pair Generator runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [Password Generator](https://toffeekit.com/tools/password-generator) — Strong random passwords from your browser's crypto.
- [Text Redactor](https://toffeekit.com/tools/text-redactor) — Hide emails, phones, cards and more in any text.
- [Passphrase Generator](https://toffeekit.com/tools/passphrase-generator) — Memorable random-word passphrases with entropy.
- [Password Strength Checker](https://toffeekit.com/tools/password-strength-checker) — Test a password's strength and crack time privately.
- [Text Encrypt / Decrypt](https://toffeekit.com/tools/text-encryption) — Encrypt messages with a password using AES-256.
- [File Encrypt / Decrypt](https://toffeekit.com/tools/file-encryption) — Password-protect any file with AES-256 encryption.

