Skip to content
ecdsa.com
RecommendedShort Weierstrass

P-256

P-256 (secp256r1, prime256v1) is the most widely deployed elliptic curve: TLS, X.509, JOSE ES256, WebAuthn and DNSSEC all use it.

P-256 is a short Weierstrass curve y² = x³ + ax + b over a 256-bit prime field with a 256-bit prime-order subgroup and cofactor 1; its estimated security level is 128 bits. Status: recommended for new systems.

P-256 is the short Weierstrass curve y² = x³ − 3x + b over the prime p = 2^256 − 2^224 + 2^192 + 2^96 − 1, whose special form allows fast reduction. Its group has prime order (cofactor 1) of about 2^256, giving roughly 128 bits of security. The same curve carries three names: P-256 (NIST, JOSE, COSE), secp256r1 (SEC 2, TLS) and prime256v1 (ANSI X9.62, OpenSSL).

A public key is a point: 65 bytes uncompressed (0x04 ‖ x ‖ y) or 33 bytes compressed. An ECDSA signature is 64 bytes as raw r ‖ s (JOSE, WebCrypto) and usually 70–72 bytes in DER (X.509, TLS, OpenSSL, WebAuthn assertions); mixing up the two encodings is one of the most common interoperability bugs, and the DER ⇄ raw converter translates between them.

Hardware support is broad: Apple's Secure Enclave creates only P-256 keys, and FIDO2 security keys and platform authenticators commonly create P-256 passkeys (COSE algorithm −7, ES256). As with the other NIST curves, b was derived from a SHA-1 seed whose origin is not documented, which is one reason some protocol designers prefer Curve25519; no weakness in P-256 has been found.

Names in standards

StandardName
NIST FIPS 186-5 / SP 800-186P-256
SEC 2secp256r1
ANSI X9.62prime256v1
JOSE / COSEP-256
SSHnistp256

Object identifiers

Domain parameters

256-bit prime field · about 128-bit security

Field prime p
0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
Coefficient a
0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc
Coefficient b
0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
Base point x
0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
Base point y
0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5
Order n of the base point
0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551
Cofactor h
0x1
Seed
0xc49d360886e704936a6678e1139d26b7819f7e90

Used in

  • TLS 1.3
  • X.509 / Web PKI
  • JOSE (ES256)
  • COSE (ES256, ESP256)
  • SSH (ecdsa-sha2-nistp256)
  • DNSSEC (algorithm 13)
  • WebAuthn / passkeys
  • Apple Secure Enclave

Identifiers in registries

TLS supported groups
secp256r1 0x0017SecP256r1MLKEM512 0x11E9SecP256r1MLKEM768 0x11EBSecP256r1Kyber768Draft00 0x639A
TLS signature schemes
ecdsa_secp256r1_sha256 0x0403
JOSE algorithms
ES256HPKE-0HPKE-0-KEHPKE-7HPKE-7-KE
JWK curves
P-256
COSE algorithms
ESP256 -9
COSE elliptic curves
P-256 1
SSH key exchange methods
ecdh-sha2-nistp256gss-nistp256-sha256-*mlkem768nistp256-sha256
SSH public key algorithms
ecdsa-sha2-nistp256x509v3-ecdsa-sha2-nistp256
DNSSEC algorithm numbers
ECDSAP256SHA256 13
HPKE KEM identifiers
DHKEM(P-256, HKDF-SHA256) 0x0010DHKEM(CP-256, HKDF-SHA256) 0x0013MLKEM768-P256 0x0050

Standards and references

All curves