Dev TooloraLocal dev tools

> Crypto

Key Pair Generator

Generate an RSA, ECDSA or Ed25519 key pair in your browser and export it as PEM (PKCS#8 and SPKI) or JWK.

Runs locallyWorks offline
Back to results
Input

Source data

Format
Output

Result

Your result will appear here.

Tool guide

About this tool.

  • A key pair is a private key you keep secret and a public key you share. Whatever the private key signs, the public key can verify, and nobody can forge a signature without the private key.
  • This tool generates RSA (2048, 3072 or 4096 bits), ECDSA (P-256, P-384 or P-521) and Ed25519 pairs with the Web Crypto API. You can export them as PEM (PKCS#8 private key, SPKI public key) or as JSON Web Keys.
  • Keys are generated in your browser and are never uploaded. They are not saved anywhere, so copy or save the result before you leave.

  • Create a signing key for JWTs, for example RS256, ES256 or EdDSA, and paste it into a JWT tool or your configuration.
  • Make throwaway keys for tests, fixtures and local development.
  • Inspect or convert one key later: paste a single PEM block into the PEM Key Inspector, or a single PEM block or JWK into the JWK ↔ PEM Converter. JWK output is ready for a JWKS document. Do not use generated keys for production secrets you cannot rotate.

Choose the algorithm: RSA, ECDSA or Ed25519.

For RSA pick the key size, for ECDSA pick the curve.

Choose PEM or JWK as the output format and run the tool.

Copy or save the result. The private key comes first, then the public key.

  • RSA 2048 as PEM → a -----BEGIN PRIVATE KEY----- block followed by a -----BEGIN PUBLIC KEY----- block.
  • RSA 3072 as JWK → kty RSA with n, e (AQAB), d, p, q, dp, dq and qi in the private key.
  • ECDSA P-256 as PEM → a short key suited to ES256 JWTs.
  • ECDSA P-384 as JWK → kty EC, crv P-384, with x and y (and d for the private key).
  • Ed25519 as PEM → the smallest PEM pair, used for EdDSA signatures.
  • Ed25519 as JWK → kty OKP, crv Ed25519, with x and d.

  • Private keys are exported as unencrypted PKCS#8 PEM and public keys as SPKI PEM.
  • JWK output lists privateKey and publicKey objects; alg, ext and key_ops are removed so the keys work with any consumer.
  • RSA keys use the RSASSA-PKCS1-v1_5 algorithm with SHA-256 and the public exponent 65537 (AQAB).
  • ECDSA keys support the NIST curves P-256, P-384 and P-521.
  • RSA 4096 can take several seconds, so the tool does not run automatically: press Run.
  • Ed25519 needs a recent browser; if it is missing the tool says so and you can pick RSA or ECDSA.
  • Every run creates a new pair, so results change each time.

FAQ

Questions about Key Pair Generator

Which algorithm should I choose?

Ed25519 or ECDSA P-256 are small, fast and widely supported. Use RSA 2048 or 3072 when a system only accepts RSA. RSA 4096 is slower to generate and rarely needed.

Are my keys sent or stored anywhere?

No. Keys are created by the Web Crypto API in your browser. Nothing is uploaded and nothing is kept after you close the page, so save the private key somewhere safe.

Why does Ed25519 fail in my browser?

Older browsers do not support Ed25519 in Web Crypto. The tool then reports that this browser cannot generate Ed25519 keys; pick RSA or ECDSA instead.

Should I export PEM or JWK?

PEM is the text format used by OpenSSL, SSH tooling and most servers. JWK is JSON, used by JWT, JWKS and Web Crypto. Both describe the same key, so pick whichever your consumer needs.

Continue with

PEM Key InspectorIdentify one PEM key container and public fingerprint without exporting key bytes, decrypting private keys or certifying strength.JWT DebuggerDecode, verify and sign JSON Web Tokens locally: HS, RS, PS, ES and EdDSA algorithms with secrets, PEM keys, certificates, JWK or JWKS, plus readable exp, nbf and iat times.Certificate InspectorInspect one PEM certificate, its fingerprints and time window without claiming signature, hostname or trust verification.