Key Pair Generator

Pick a curve and get a public and private key as PEM and as JWK, for ES256, ES384 or EdDSA signatures. The keys are made on this device by your browser’s own WebCrypto and never leave it.

How it works

An elliptic-curve key pair is a private number and a public point derived from it on a fixed curve. This page asks your browser’s WebCrypto to pick the private number at random and work out the public point. Nothing about the curve or the key is fetched from anywhere.

Each key is written twice. PEM ("BEGIN PUBLIC KEY", "BEGIN PRIVATE KEY") is what OpenSSL, Node, Go and Java read. JWK is a small JSON object that JWT libraries and web APIs read. The fingerprint is the SHA-256 of the public key’s bytes, so you can check two copies are the same key.

Ed25519 arrived in browsers later than the other curves: Chrome 137, Firefox 129 and Safari 17. If your browser cannot make Ed25519 keys, that choice is turned off and the page says so, rather than failing when you press it. Nothing is uploaded or stored in any case.

How to use it

  1. 1 Pick a Curve: P-256, P-384 or Ed25519.
  2. 2 The public and private key appear as PEM and as JWK, with the SHA-256 fingerprint.
  3. 3 Copy or download the form your software wants.
  4. 4 Press Regenerate for a new pair. The old one is not kept anywhere.

Good to know

  • P-256 is the safe default: every library supports it, and it is what ES256 JWTs use.
  • Ed25519 is fast and hard to misuse, and the JWT name for it is EdDSA. Check that the system on the other end accepts it before you choose it.
  • The private JWK has a "d" field; the public one does not. Never paste a JWK with "d" into anything public.
  • The private key is not encrypted. To add a passphrase: openssl pkcs8 -topk8 -v2 aes-256-cbc -in private.pem -out private-enc.pem
  • These keys sign; they do not encrypt. For SSH logins use the SSH Key Generator, which writes the files ssh expects.

Browser support

  • Chrome 94 and later · full speed from 137
  • Firefox 93 and later · full speed from 129
  • Safari 16.4 and later · full speed from 17
  • Edge 94 and later · full speed from 137

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Why an Ed25519 public key is 44 bytes and an RSA one is 294

The quickest way to see why elliptic curves took over from RSA for signatures is to make one key of each kind and count the bytes. We did exactly that and checked the numbers in Node. A 2048-bit RSA public key in SPKI form is 294 bytes. A P-256 public key is 91 bytes. A P-384 key is 120 bytes. An Ed25519 key is 44 bytes. The P-256 and Ed25519 keys are the stronger two of those four.

Strength is measured in "bits of security": roughly, how many operations the best known attack needs, as a power of two. P-256 and Ed25519 both give about 128 bits. P-384 gives about 192. RSA needs a 3072-bit modulus to reach 128 bits, and 2048-bit RSA sits at about 112. So for the same strength an RSA-3072 public key is over 400 bytes, while the Ed25519 key that matches it is 44.

Those 44 bytes are mostly the key itself. The first 12 bytes, which always Base64 to MCowBQYDK2VwAyEA, are the wrapper: a sequence, the identifier 1.3.101.112 that names Ed25519, and a header saying 32 bytes follow. The last 32 bytes are the public key. A P-256 key carries more wrapper (two identifiers, one for "elliptic curve" and one for the curve) and then 65 bytes for the point: a 04 byte meaning "uncompressed", then the 32-byte x and the 32-byte y. That is the 91. The same two numbers appear in the JWK as "x" and "y", in Base64url.

Signatures follow the same pattern. A P-256 signature is 64 bytes, the two 32-byte numbers r and s side by side, which is also the exact form ES256 JWTs use. A P-384 signature is 96 bytes. An Ed25519 signature is 64 bytes. An RSA-2048 signature is 256 bytes, and signing with RSA is much slower, because the private operation works on numbers eight times longer.

The private side tells a similar story. A P-256 private key in PKCS#8 is 138 bytes, and an Ed25519 one is 48, of which 32 bytes are the random seed. In the JWK the private value is "d". That one field is the whole secret: anyone with "d" can sign as you, which is why the page shows the public JWK separately and why you should check which one you are pasting.

Small keys are not the only reason to pick a curve, and not every system takes every curve. P-256 is supported almost everywhere, from TLS certificates to cloud key stores. Ed25519 is newer in browsers and in some enterprise software, so check before you build on it. And none of these keys is useful for SSH as written here, because SSH has its own file format; the SSH Key Generator writes that one.

Frequently asked questions

Which curve should I choose?

P-256 if you need it to work everywhere, including ES256 JWTs. Ed25519 if both ends support it and you want the simplest, fastest option. P-384 only if a policy asks for more than 128-bit security.

Is it safe to make a private key in a browser?

The key is made by WebCrypto with the operating system’s random number generator, the same source native tools use, and this page sends nothing anywhere. It keeps working offline once loaded. What matters afterwards is where you save the private key.

Why is the Ed25519 option turned off for me?

Your browser’s WebCrypto does not support Ed25519 yet. It needs Chrome or Edge 137, Firefox 129 or Safari 17 or later. The page tests for it by trying, because the feature cannot be detected any other way.

What do crv, x, y and d mean in the JWK?

"kty" is the key type (EC for the P curves, OKP for Ed25519). "crv" names the curve. "x" and "y" are the coordinates of the public point; Ed25519 keys have only "x". "d" is the private key. All values are Base64url.

Can I use these keys to encrypt files?

Not directly. They are signing keys. Elliptic-curve encryption needs a key agreement scheme such as ECDH on top, which this page does not do.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.