EC / ECDSA Key Pair Generator (P-256, secp256k1, Ed25519)
Generate an EC key pair on nine curves — P-256, secp256k1, brainpool, SM2, Ed25519 — as PEM, JWK, OpenSSH or raw bytes, optionally encrypted. Free, no upload.
EC keys are small and fast — even P-521 generates almost instantly. P-256 is the common default; secp256k1 is the curve Bitcoin and Ethereum sign with, and Ed25519 is what modern SSH uses.
With a passphrase the private key is written as an encrypted PEM — PBES2 with PBKDF2-SHA256 (600,000 rounds) and AES-256-CBC, which OpenSSL and any JOSE library open with the same passphrase.
🔒 Keys are generated in your browser with the Web Crypto API — nothing is uploaded. Keep your private key secret and never share it.
What this EC key generator does
This tool creates a fresh elliptic-curve (ECDSA) public/private key pair entirely inside your browser using the built-in Web Crypto API. Pick a curve — P-256, P-384, P-521, secp256k1, the three brainpool curves, SM2 or Ed25519 — set a passphrase if you want the private key encrypted, and click Generate. You get the public key as SPKI PEM (-----BEGIN PUBLIC KEY-----) and the private key as PKCS#8 PEM (-----BEGIN PRIVATE KEY-----), plus both keys as JSON Web Keys (JWK). Under More formats you also get the legacy SEC1 -----BEGIN EC PRIVATE KEY----- block, an OpenSSH authorized_keys line with its matching openssh-key-v1 private key, and the raw bytes as hex or base64. With a passphrase the private key comes out as an encrypted PEM (PBES2: PBKDF2-SHA256 at 600,000 rounds, AES-256-CBC). Copy or download any block with one click. These are standard formats, so they drop straight into OpenSSL, SSH tooling, JWT/JOSE libraries (ES256, ES384, ES512), TLS configs and WebAuthn code.
EC versus RSA, and keeping your private key safe
Elliptic-curve keys are far smaller and faster to generate than RSA at the same security level — a 256-bit P-256 key is roughly comparable to a 3072-bit RSA key — which is why ECDSA is the modern default for TLS, SSH and JWT signing. Choose P-256 unless a specification or partner requires otherwise: P-384 or P-521 for a larger margin, secp256k1 for Bitcoin and Ethereum, Ed25519 for SSH, brainpool or SM2 where a national standard asks for them. The public key is safe to share with anyone who needs to verify your signatures; the private key must stay secret, because anyone who holds it can sign as you. Since generation runs locally through crypto.subtle.generateKey, your private key is never transmitted, logged or stored on any server — it exists only in your browser tab until you copy it. Web Crypto requires a secure context, so the generator works over https or on localhost. A key generated in a browser is still not a production key — anything that signs real traffic belongs in a hardware-backed or non-exportable keystore, and the page says so.
Frequently asked questions
Which curves can I generate?
Nine. P-256, P-384 and P-521 — the NIST prime curves, also known as secp256r1, secp384r1 and secp521r1, which pair with ES256, ES384 and ES512 in JWT and JOSE. secp256k1 (ES256K), the curve Bitcoin and Ethereum sign with. brainpoolP256r1, brainpoolP384r1 and brainpoolP512r1 from RFC 5639, and SM2 (sm2p256v1) from the Chinese standard. And Ed25519, the EdDSA curve modern SSH uses. Your browser's Web Crypto API only knows four of these; the other five are computed in the page itself, so nothing is uploaded for them either.
What key formats do I get?
The public key as SPKI PEM (-----BEGIN PUBLIC KEY-----) and the private key as PKCS#8 PEM (-----BEGIN PRIVATE KEY-----), both keys as JWK objects, the legacy SEC1 -----BEGIN EC PRIVATE KEY----- block, an OpenSSH public-key line for authorized_keys with its matching openssh-key-v1 private key, and the raw key bytes as hex or base64. Set a passphrase and the private key is written as an encrypted PEM (-----BEGIN ENCRYPTED PRIVATE KEY-----) that OpenSSL and any JOSE library open with the same passphrase.
Can I use these keys in production?
Treat them as development, test and learning keys. A key made in a browser tab has been through JavaScript that any extension on the page could read, and the curves computed here use variable-time arithmetic. Anything that signs real traffic should be generated where the private key cannot be exported — an HSM, a cloud KMS, or ssh-keygen on the machine that will use it.
Are the keys generated on a server?
No. Everything happens locally in your browser with the Web Crypto API. The public and private keys are never sent to, logged by or stored on any server — they are created only inside your browser tab and disappear when you close it.
Should I use EC or RSA keys?
EC (ECDSA) keys are smaller and faster and are the modern default for TLS, SSH and JWT signing. Use RSA only when you must interoperate with a system that specifically requires it. For EC, P-256 is a solid default with a strong security margin.