Generate EC key

Generate an elliptic-curve key pair on a selected SEC1 curve.

freeworks offlinenothing uploaded
ToolEC Key Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A private scalar is chosen within the curve order and multiplied by the generator point to produce the public point; the key is serialized in the selected SEC1 or PKCS#8 format. The curve parameters define the field, generator, and order used for that multiplication.

  • secp256k1 is common in blockchain tooling, while P-256 is common in Web Crypto and TLS.

Worked example

Generate P-256 Key Pair
Generate an ECDSA P-256 key pair in JWK format
Input
											Curve: P-256
Format: jwk
										
Output
												=== EC Public Key (P-256, JWK) ===
{
  "crv": "P-256",
  "ext": true,
  "key_ops": [
    "verify"
  ],
  "kty": "EC",
  "x": "aj7Qm5ZhAjDhv-nCudAhDdtw2_8cr1A1KFI8rThs-w4",
  "y": "GIi0Lrl96-ndnFtznnv8M_ZNiOrThAnr6mabRXRKGNc"
}

=== EC Private Key (P-256, JWK) ===
{
  "crv": "P-256",
  "d": "lesTspB1cQpwBTGHdQw8PrnMc2qtuumH3kLCNiNftF4",
  "ext": true,
  "key_ops": [
    "sign"
  ],
  "kty": "EC",
  "x": "aj7Qm5ZhAjDhv-nCudAhDdtw2_8cr1A1KFI8rThs-w4",
  "y": "GIi0Lrl96-ndnFtznnv8M_ZNiOrThAnr6mabRXRKGNc"
}
											

When to use this

Wallets, TLS clients, and test fixtures generate elliptic-curve keys.

Edge cases

  • A private scalar of zero or at least the curve order is invalid.
  • Compressed and uncompressed public points serialize differently but represent the same point.
  • A private key is secret material and should not be pasted into public logs.

References