← Developer

Key Pair Generator

Generate RSA or EC key pairs directly in your browser and export as PEM or JWK. Keys are created locally and never leave your device.

Key type
Export format

How it works

This generator uses your browser's built-in crypto.subtle.generateKey Web Crypto API to create the key pair entirely on your device. For RSA you can choose 2048 or 4096 bits and either RSASSA-PKCS1-v1_5 for signing or RSA-OAEP for encryption. For elliptic curve you can choose the P-256 or P-384 ECDSA curves. The public key is exported in SPKI form and the private key in PKCS8, then Base64-encoded and wrapped with the standard PEM header lines. You can also switch to JWK to get the JSON Web Key representation of each key.

Everything happens locally. The keys are generated in memory, never sent to a server, and there is no signup or tracking. Copy either key to the clipboard or download it as a file. It works on any modern browser, on both mobile and desktop.


Frequently asked questions

Do the generated keys ever leave my device?

No. The key pair is created with the Web Crypto API in your browser and held only in page memory. Nothing is uploaded, logged, or transmitted. Reloading the page discards the keys, so save anything you need before you leave.

What is the difference between PEM and JWK output?

PEM is the familiar text block with -----BEGIN PUBLIC KEY----- headers, containing Base64 of the DER encoding (SPKI for the public key, PKCS8 for the private key). JWK is a JSON object describing the same key, which is convenient for JavaScript, JOSE, and many APIs. Both represent the identical key material.

Should I pick RSA or EC?

EC keys like P-256 are much smaller and faster while offering comparable security to a large RSA key, so they are a good default for new systems. Choose RSA when you need to interoperate with software that expects RSA, or when you specifically need RSA-OAEP encryption.

Are these keys safe to use in production?

The randomness comes from the same vetted Web Crypto implementation your browser uses for TLS, so the key material is cryptographically sound. Whether a given key is appropriate depends on your threat model, key storage, and rotation policy. Treat the private key as a secret and store it securely.

More tools from Clean.tools

View all tools

Use Clean.tools from your AI agent

Clean.tools also runs an MCP server — read-only utility tools your AI agent can call directly. No key, no signup: requests are processed in memory and request contents are never stored.

Claude Code
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcp
Any MCP client (streamable HTTP, authless)
https://mcp.clean.tools/mcp

Every tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →