# Key pair

> Generate RSA, EC, and Ed25519 keys, and convert PEM and JWK.

Free key pair generator. Create an RSA, ECDSA, or Ed25519 key in the browser and copy PEM, JWK, and a JWKS. Convert between PEM and JWK. The private key is not sent, logged, or stored.

- Page: https://benchline.fabwaseem.com/t/rsa-keypair
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: An algorithm, an RSA size, or a PEM or JWK to convert.
- Output: Public and private PEM, public and private JWK, and a JWKS document.
- Keywords: rsa key generator, pem to jwk, ed25519 key generator
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Choose an algorithm.** Ed25519 and ES256 are the short options. RSA needs a modulus of 2048 or 4096.
2. **Generate or paste.** Generate a new pair, or paste PEM or JWK to convert.
3. **Copy the public key.** Share the public PEM or JWKS. Keep the private PEM off the clipboard until you need it.

## Use it from an AI agent

MCP tool name: `generate_keypair`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/rsa-keypair with the input as the JSON body
This call does not fetch anything. It runs on the arguments you send.

Generate an RSA, EC, or Ed25519 key pair as PEM and JWK, or convert between PEM and JWK. The private key is returned in the result and is not stored. The page in the browser generates keys locally and does not send them.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "action": {
      "default": "generate",
      "type": "string",
      "enum": [
        "generate",
        "to_jwk",
        "to_pem"
      ]
    },
    "alg": {
      "default": "ES256",
      "type": "string",
      "enum": [
        "RS256",
        "RS384",
        "RS512",
        "PS256",
        "ES256",
        "ES384",
        "ES512",
        "Ed25519"
      ]
    },
    "modulusLength": {
      "default": 2048,
      "anyOf": [
        {
          "type": "number",
          "const": 2048
        },
        {
          "type": "number",
          "const": 4096
        }
      ]
    },
    "pem": {
      "description": "SPKI or PKCS8 PEM to convert. Required for to_jwk.",
      "type": "string"
    },
    "jwk": {
      "description": "JWK JSON to convert. Required for to_pem.",
      "type": "string"
    }
  },
  "required": [
    "action",
    "alg",
    "modulusLength"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "generate_keypair",
    "arguments": {
      "action": "generate",
      "alg": "ES256",
      "modulusLength": 2048
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### Does the private key leave this browser?

No. Generation and conversion run in the page. The private key is not sent, logged, or stored.

### Which algorithms are available?

RS256, RS384, RS512, PS256, ES256, ES384, ES512, and Ed25519. RSA sizes are 2048 and 4096.

### What is the JWKS for?

It is a key set containing only the public key, which is what a verifier should receive. The private JWK is separate.

## Related tools

- [JWT decoder](https://benchline.fabwaseem.com/t/jwt-decoder): Paste a JSON Web Token, read the claims, and verify the signature in the browser.
- [Bcrypt hash](https://benchline.fabwaseem.com/t/htpasswd-bcrypt): Hash and verify passwords with bcrypt or argon2id. Nothing is stored.
- [Hash generator](https://benchline.fabwaseem.com/t/hash-generator): MD5, SHA-1, SHA-256, and SHA-512 checksums for text or a file, with HMAC.
- [Password generator](https://benchline.fabwaseem.com/t/password-generator): Cryptographic passwords and passphrases, with an entropy strength meter.
