FormatterHQ

ECDSA & Ed25519 Key Generator

Create an elliptic-curve key pair on P-256, P-384, P-521 or Ed25519 and export it as PEM or JWK, ready for JWT signing, TLS or API authentication.

Output TEXT
Ready.

How to use the ECDSA & Ed25519 Key Generator

  1. Pick a Curve: P-256, P-384, P-521 or Ed25519.
  2. Choose the Format: PEM PKCS#8 / SPKI, PEM SEC1, or JWK / JWKS.
  3. Click Generate key pair.
  4. Store the private key securely and distribute the public key or JWKS.

Create elliptic-curve keys with this ECDSA key generator

This ecdsa key generator creates elliptic-curve key pairs with WebCrypto. EC keys are much smaller than RSA keys of similar strength, and signing with them is faster, which is why ES256 is a popular JWT algorithm and P-256 is widely used in TLS. The tool also creates Ed25519 keys for EdDSA.

Choosing a curve

CurveJWT algorithmNotes
P-256 (secp256r1, prime256v1)ES256The most widely supported choice
P-384ES384Required by some government and high-assurance profiles
P-521ES512Largest NIST curve, less commonly used
Ed25519EdDSADeterministic signatures, fast, 32-byte keys

Ed25519 depends on browser support. If your browser does not offer it in WebCrypto, the tool says so and you can pick P-256 instead or update the browser.

Formats explained

  • PKCS#8 / SPKI: BEGIN PRIVATE KEY and BEGIN PUBLIC KEY. Works with jose, Node.js, Java and Go.
  • SEC1: BEGIN EC PRIVATE KEY, the classic OpenSSL format, plus an SPKI public key. It exists for the P curves only, so Ed25519 keys are always shown in PKCS#8.
  • JWK / JWKS: a private JWK and a public JWKS with alg, use: "sig" and a kid derived from the public key hash.

Example

The public part of a P-256 key in JWK format:

{
  "keys": [
    {
      "kty": "EC",
      "x": "RLVHTEmboKyxlzoYnQfN8weFO6bQ1nZXIlfUHpw2d_I",
      "y": "JQTKuNKCT8Wy35lx40mdkc5_N87-P_2CiLRZF3kaD9o",
      "crv": "P-256",
      "alg": "ES256",
      "kid": "7-XNZjnLVIzRhP9Y",
      "use": "sig"
    }
  ]
}

The private JWK has the same members plus d, the secret scalar. Never publish the private JWK.

Common mistakes

  • Curve and algorithm mismatch: a P-384 key cannot sign ES256 tokens. Each curve pairs with exactly one JWT algorithm, as shown in the table above.
  • Library cannot read the key: code that expects BEGIN PRIVATE KEY usually rejects SEC1 files. Generate again in PKCS#8 format.
  • Signature size surprises: JWT uses raw 64-byte ES256 signatures, while TLS and X.509 use DER-encoded ones. Let your library handle the conversion.

Next steps

Paste the private PEM or JWK into the JWT encoder with ES256 or EdDSA to sign a test token. Need the PEM form of a JWK later? Use the JWK to PEM converter. For server logins, generate keys in OpenSSH format with the SSH key generator, because this page outputs PEM and JWK only.

Checking and using the key with OpenSSL

Once you have saved the PEM files, OpenSSL can confirm what you generated and sign a test file with it. For the P curves:

# show the curve and the public point
openssl pkey -in private.pem -text -noout

# sign a file and verify the signature
openssl dgst -sha256 -sign private.pem -out file.sig file.txt
openssl dgst -sha256 -verify public.pem -signature file.sig file.txt

The last command prints Verified OK when the two halves belong together, which is a quick way to make sure you did not mix up keys from two different runs. Use -sha384 with P-384 and -sha512 with P-521 to match ES384 and ES512. Ed25519 keys sign the message directly without a separate digest, so use openssl pkeyutl -sign -rawin instead of dgst.

Privacy

Keys are generated in your browser by WebCrypto. They are not uploaded, logged or stored, so save the private key before you leave the page.

Frequently asked questions

Is P-256 the same as secp256r1 and prime256v1?
Yes. They are three names for the same NIST curve. OpenSSL calls it prime256v1, SEC documents call it secp256r1, and JOSE and WebCrypto use P-256.
Should I use ECDSA or Ed25519?
Ed25519 is simpler to use safely because its signatures are deterministic, and it is fast. ECDSA P-256 has wider support in older libraries, hardware security modules and TLS stacks, so check what your verifier accepts.
Can I use secp256k1, the Bitcoin curve?
No. WebCrypto supports only P-256, P-384, P-521 and Ed25519 for signing, so secp256k1 and Brainpool curves are not available here.
How do I convert a SEC1 key to PKCS#8?
Run openssl pkcs8 -topk8 -nocrypt -in ec.key -out ec-pkcs8.key, or generate the key again with the PKCS#8 format selected. Both formats hold the same private scalar.

Last updated September 26, 2026

Related tools

RSA Key Pair Generator Generate RSA 2048, 3072 or 4096-bit public/private key pairs in PEM (PKCS#8, PKCS#1) or JWK format with WebCrypto, entirely offline. SSH Key Generator Generate OpenSSH key pairs (Ed25519, RSA, ECDSA) in id_ed25519 / id_rsa format with fingerprint — created locally, like ssh-keygen. Encrypt & Decrypt Text Encrypt or decrypt text with AES, Triple DES, Rabbit, RC4 or Blowfish using a secret passphrase — in your browser. Hash Identifier Identify hash types from their format: MD5, SHA-1/256/512, bcrypt, Argon2, sha512crypt, NTLM, MySQL, phpass, Django and more. HMAC Generator Generate HMAC-SHA256, HMAC-SHA1, HMAC-SHA512, HMAC-MD5 and SHA-3 HMACs with a secret key, as hex or Base64. Htpasswd Generator Create .htpasswd entries for Apache and Nginx basic auth with bcrypt, APR1-MD5 or SHA-1 — one username:password per line. Keccak Hash Generator Generate original Keccak-224/256/384/512 hashes, including the Keccak-256 used by Ethereum and Solidity. MD2 Hash Generator Generate the MD2 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. MD4 Hash Generator Generate the MD4 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. MD5 Hash Generator Generate the MD5 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. NTLM Hash Generator Generate the Windows NTLM (NT) password hash — MD4 of the UTF-16LE password — online. Password Strength Checker Estimate password entropy and crack time for online and offline attacks, and spot common patterns — checked privately in your browser.