Public/Private Key Pair Generator

Create a public and private key pair for signing tokens, setting up SSH, testing an API that uses JWS or JWE, or trying out public-key cryptography. Choose Ed25519, RSA (2048, 3072 or 4096 bits) or ECDSA (P-256, P-384, P-521), then copy or download the keys as PEM, JWK or OpenSSH. The keys are made by your browser's Web Crypto API and never leave your device.

Helps you tell keys apart in GitHub or authorized_keys.

Key generation runs in your browser. What you type never leaves this device.

Features

  • Ed25519, RSA 2048/3072/4096 and ECDSA P-256/P-384/P-521

  • RSA for signing (PKCS#1 v1.5 or PSS) or encryption (OAEP)

  • PEM: public key as SPKI, private key as PKCS#8, readable by OpenSSL, Node.js, Java, Go and Python

  • JWK for JOSE libraries and JWKS endpoints

  • OpenSSH public line and private key file, with an optional comment

  • SHA256 fingerprint in the same form as ssh-keygen -l

  • Runs in your browser: keys are never sent, logged or stored

What the keys are for

Signing JWTs

An RS256, PS256, ES256 or EdDSA key pair: the private key signs, and services verify with the public key from your JWKS. Try it in the [JWT generator](/tools/jwt-generator).

SSH access

An Ed25519 or RSA key for servers and Git hosting; the [SSH key generator](/tools/ssh-key-generator) explains the steps.

Webhooks and API partners

Some gateways ask for your public key to verify signed requests, or give you theirs.

Learning and testing

See what PEM, JWK and OpenSSH keys look like and test code that loads them, without installing OpenSSL.

Choosing an algorithm and format

Algorithm

  • Ed25519: small, fast, modern. Best for SSH and new systems. Needs a recent browser (Chrome 137+, Firefox 129+, Safari 17+).
  • ECDSA P-256: small keys, very widely supported (ES256 in JWT, TLS certificates).
  • RSA: supported everywhere. Use 3072 bits for new keys; 2048 is still accepted; 4096 is slower to generate and use.

Format

  • PEM text with BEGIN PUBLIC KEY (SPKI) and BEGIN PRIVATE KEY (PKCS#8) is what most libraries load.
  • JWK is JSON; the public JWK goes in a JWKS endpoint for JWT verification.
  • OpenSSH is for ~/.ssh and authorized_keys.

Protecting the private key

The private key is shown without a passphrase. Store it in a secrets manager or a file only you can read. To add a passphrase to a PEM key: openssl pkey -in private.pem -aes256 -out private-enc.pem. For an OpenSSH key: ssh-keygen -p -f id_ed25519. For long-lived production keys, many teams prefer to generate them on the server or in a cloud key service instead.

Public/Private Key Pair Generator - FAQ