Start a project

Tool 83 of 100 · Crypto

Key Pair Generator

Generate key pairs and secret keys in your browser, export them as PEM, JWK, JWKS or an OpenSSH public key with fingerprints, and identify any PEM you paste.

Key Pair Generator at a glanceIllustration: 1, A key type; 2, processed in your browser; 3, PEM, JWK, SSH.Key Pair Generator1A key type</>3PEM, JWK, SSH2In yourbrowser
1 A key type 2 processed on your device 3 PEM, JWK, SSH

Key Pair Generator

Generate

PropertyValue

Keys

Public key (SPKI PEM)
OpenSSH public key (authorized_keys line)
JWKS (public) and private JWK
Private key (PKCS#8 PEM): keep secret

What is this key?

    PropertyValue

    01

    What it does

    Generates RSA, ECDSA, ECDH, Ed25519 and X25519 key pairs and AES or HMAC keys with WebCrypto, exported as PEM, JWK, JWKS and OpenSSH.

    • RSA 2048 to 4096, ECDSA and ECDH P-256 to P-521, Ed25519 and X25519
    • AES-GCM and HMAC secret keys
    • PKCS#8 and SPKI PEM, JWK and JWKS
    • OpenSSH public key and SHA-256 fingerprint

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    PEM, JWK, JWKS and OpenSSH keys, with a Copy and a Download button on every result.

    • Keys
    • RSA
    • Ed25519
    • JWK

    Why it matters

    Development needs keys all the time: signing JWTs, testing webhooks, encrypting a field, setting up SSH for a deploy. Command-line tools work but the flags are hard to remember, and each format (PEM, JWK, OpenSSH) needs a different command.

    This generator uses the browser's WebCrypto, which draws on the operating system's secure random source, and exports each key in every format you're likely to need, with a kid from the RFC 7638 thumbprint. Paste any PEM to find out what kind of key it is and whether it's strong enough.

    How it works

    1. InputKey type and size
    2. In your browserGenerated with WebCrypto, never sent anywhere
    3. OutputPEM, JWK, SSH and a thumbprint

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Setting up signing, SSH or test keys.

    By the numbers

    Public key size for each key type, generated by the toolRSA 2048: 294 bytes public; RSA 3072: 422 bytes public; RSA 4096: 550 bytes public; ECDSA P-256: 91 bytes public; ECDSA P-384: 120 bytes public; Ed25519: 44 bytes public; X25519: 44 bytes publicRSA 2048294 bytes publicRSA 3072422 bytes publicRSA 4096550 bytes publicECDSA P-25691 bytes publicECDSA P-384120 bytes publicEd2551944 bytes publicX2551944 bytes public
    Generated with WebCrypto in this tool and exported as SPKI DER. A 256-bit elliptic-curve key gives roughly the security of RSA 3072 at a fraction of the size, which is why Ed25519 and P-256 are the usual choice for new keys. Source: NIST SP 800-57 Part 1.
    Show the numbers as a table
    KeyPublic (bytes)Private PKCS#8 (bytes)
    RSA 20482941217
    RSA 30724221792
    RSA 40965502374
    ECDSA P-25691138
    ECDSA P-384120185
    Ed255194448
    X255194448

    How to use it

    1. Choose the key type and size.
    2. Set a key ID and use, or leave the defaults.
    3. Generate, then download the public and private keys.
    4. Paste a PEM below to identify an existing key.

    FAQ

    Is a browser-generated key secure?

    Yes. WebCrypto uses the operating system's cryptographic random generator, the same as OpenSSL. The keys exist only in this tab until you save them.

    Which key type should I pick?

    Ed25519 for SSH and signing where supported; ECDSA P-256 for JWTs (ES256) and wide support; RSA 3072 where older systems need RSA.

    Can I use the OpenSSH line in authorized_keys?

    Yes. It's the standard one-line format, with the comment you set.

    Why doesn't my old key work with WebCrypto?

    WebCrypto reads PKCS#8 private keys (BEGIN PRIVATE KEY). Older BEGIN RSA PRIVATE KEY files need converting with openssl pkcs8 -topk8 -nocrypt.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk