Developer Tools· 4 min read

SSH Key Generator: Create RSA Keypairs with Browser-Only Crypto

Generate 2048, 3072, or 4096-bit RSA keypairs using Web Crypto and export them as PEM files.

By EasyDevTools Team Last updated: 2026-08-24

Why generate keys in the browser

RSA keypairs are the backbone of TLS handshakes, code signing, and SSH authentication. Generating them on a remote server means your private key traverses a network — even over HTTPS, that introduces a trust layer you may not want. The Web Crypto API available in every modern browser provides the same cryptographic primitives used by TLS itself, running entirely on your machine with zero network interaction.

This tool uses `crypto.subtle.generateKey` with RSASSA-PKCS1-v1_5 to produce an RSA keypair, then exports the public key in SPKI PEM format and the private key in PKCS#8 PEM format. A SHA-256 fingerprint is computed from the public key for identification purposes. The entire workflow — generation, export, and fingerprinting — stays inside your browser tab.

The output is not in OpenSSH's `authorized_keys` format, so you should not paste these keys directly into `~/.ssh/authorized_keys`. For actual SSH authentication, use `ssh-keygen` in a terminal. This tool is designed for educational exploration, development testing, and understanding how RSA keypairs are structured.

See it in action

Key size comparison

Key sizeSecurity levelGeneration time (typical)Recommended for
2048-bit~112-bit equivalentUnder 1 secondDevelopment and testing
3072-bit~128-bit equivalent1 to 3 secondsProduction applications
4096-bit~150-bit equivalent3 to 10 secondsHigh-security environments

How to generate an RSA keypair

Select your desired key size — 2048, 3072, or 4096 bits

Click the generate button to create the keypair using `crypto.subtle.generateKey`

Copy or download the public key (SPKI PEM) and the private key (PKCS#8 PEM)

Note the SHA-256 fingerprint for key identification and verification

How to verify the generated keys

After generating a keypair, inspect the public key PEM — it should begin with `-----BEGIN PUBLIC KEY-----` and end with `-----END PUBLIC KEY-----`. The private key should start with `-----BEGIN PRIVATE KEY-----`. Copy the SHA-256 fingerprint and compare it against a fingerprint computed by a different tool (such as `openssl rsa -pubout -outform DER | openssl sha256`) to confirm the keypair was generated correctly. The private key should never be shared or transmitted.

Common mistakes with browser-generated keys

Assuming the PEM output is OpenSSH-compatible and pasting it directly into `authorized_keys` — these are SPKI/PKCS#8 PEMs, not OpenSSH format

Choosing 2048-bit for production systems that will face long-term threats — NIST recommends 3072-bit or higher for security beyond 2030

Storing the private key PEM in a plaintext file on a shared machine without encryption

Reusing the same keypair across multiple services instead of generating unique keys per environment

Edge cases and limitations

The Web Crypto API requires a secure context (HTTPS or localhost), so this tool will not function over plain HTTP. Very old browsers that lack `crypto.subtle` support will fail entirely. The exported PEM is Base64-encoded DER, which is the standard interchange format but differs from OpenSSH's custom encoding. If you need an OpenSSH-formatted private key, you must convert it using a command-line tool like `openssl pkcs8 -topk8`. The SHA-256 fingerprint is computed from the SPKI public key bytes, matching the fingerprint format used by most key management systems.

Who uses a browser-based key generator

Developers learning about public-key cryptography who want to see PEM structure without installing OpenSSL

Security researchers testing how different key sizes affect generation time and key length

Educators demonstrating RSA key generation in a classroom or workshop setting

Anyone who needs a quick one-off keypair for a local development environment

Frequently asked questions

Q: Is this in OpenSSH format?

A: No — the Web Crypto API exports SPKI for the public key and PKCS#8 for the private key, not OpenSSH's `authorized_keys` or `id_rsa` format. For actual SSH authentication, use the `ssh-keygen` command in your terminal. This tool is intended for educational and development use.


Q: Where does the key come from?

A: The key is generated using `crypto.subtle.generateKey` with RSASSA-PKCS1-v1_5, the same cryptographic primitive that underpins TLS connections. The key material never leaves your browser.


Q: Which key size should I pick?

A: 2048 bits is acceptable for development environments. For production, 3072 bits or higher is recommended. 4096 bits provides the strongest security but takes longer to generate and uses more computational resources during operations like signing and verification.


Q: Is my private key uploaded?

A: No. The entire key generation, export, and fingerprinting process runs locally in your browser. No data is sent to any server.


Q: Can I encrypt the private key with a passphrase?

A: Not in this tool. The exported PKCS#8 PEM is unencrypted. If you need an encrypted private key, use `openssl pkcs8 -topk8` to add passphrase-based encryption after downloading.


Q: What algorithm is used?

A: RSASSA-PKCS1-v1_5 with configurable key sizes. The SHA-256 fingerprint is computed using the `digest` function from the same Web Crypto API.

Generate your keypair now

Create an RSA keypair entirely in your browser with the SSH Key Generator. For password hashing, try the bcrypt Hash Generator, or generate checksums with the Hash Generator. Create unique identifiers with the UUID Generator, or inspect token structure with the JWT Decoder.

Need help using this tool?

Read our complete SSH Key Generator tutorial for step-by-step guidance.

Ready to try the tool?

No accounts. No uploads. No limits. Start now.