Key Pair Generator

Pick an algorithm and generate a fresh key pair for SSH, signing, or general use. You get a PEM private key, a PEM public key, and an OpenSSH public key line, ready to copy or download. Everything runs locally — your private key never leaves your device.

Files never leave your device

What This Tool Does

This tool generates a new public/private key pair for signing, SSH, or general cryptographic use. Pick an algorithm, click generate, and you get three outputs ready to copy or download: a PEM private key, a PEM public key, and an OpenSSH public key line for the accounts and services that expect that specific format.

Everything happens on your device. The private key is created inside a WebAssembly module running in your browser tab and never travels over the network — you're the only one who ever sees it.

What a Key Pair Is

A key pair is two mathematically linked keys: a private key you keep secret, and a public key you can share freely. Anything signed with the private key can be verified by anyone holding the public key, without that person ever needing access to the private one — this is the basis for SSH authentication, code signing, and algorithms like JWT's RS256 and ES256.

Tip: The private key is the one that matters for security — share the public key as widely as you like, but treat the private key the same way you'd treat a master password: generated locally, copied once, and never sent anywhere you don't fully trust.

Choosing an Algorithm

AlgorithmKey sizeBest for
Ed25519Small, fixed-size keysRecommended default — modern, fast to generate and verify, widely supported by current SSH and signing tools
ECDSA P-256Small, fixed-size keysChoose when a specific service or standard requires ECDSA rather than Ed25519
RSA-2048Much larger keysChoose only for compatibility with older systems or requirements that specifically mandate RSA

Ed25519 is the right default for almost everyone: it's modern, produces compact keys, and both generation and verification are fast. Fall back to ECDSA P-256 or RSA-2048 only when something outside your control — an older server, a compliance policy, a legacy tool — specifically asks for one of them by name.

PEM vs OpenSSH Format

The PEM private key uses the PKCS#8 format, wrapped between BEGIN PRIVATE KEY and END PRIVATE KEY lines — this is what most programming languages and cryptographic libraries expect when you load a private key. The PEM public key uses the SPKI format the same way, wrapped between BEGIN PUBLIC KEY and END PUBLIC KEY lines. The OpenSSH public key line is a different, single-line encoding of the same public key, formatted the way SSH itself expects it — this is what goes into an authorized_keys file or an SSH key field on a Git hosting service.

Using the Key for SSH

Copy the OpenSSH public key line into the authorized_keys file on any server you want to access, or paste it into an SSH key field on a code hosting service. Keep the PEM private key on your own machine and point your SSH client at it — as long as the private key stays private, only you can authenticate with the matching public key.

Your Private Key Never Leaves Your Device

Key generation runs entirely inside a WebAssembly module loaded into your browser tab. Nothing is uploaded, logged, or transmitted — the private key exists only in this page's memory for as long as it stays open, so copy or download it before you navigate away, because it can't be recovered afterward.

If you need to decode or verify a JWT signed with RS256 or ES256, see the JWT decoder & verifier. If you need to set up two-factor authentication, see the TOTP generator & setup — both run on-device the same way this tool does.

Frequently asked questions

Is the private key uploaded anywhere?
No. The key pair is generated entirely inside your browser using WebAssembly — the private key is created on your device and never sent over the network. Copy or download it directly from the page; there's no server that ever sees it.
Which algorithm should I use?
Ed25519, unless something specific requires otherwise. It's modern, produces small keys, and is fast to generate and verify. Reach for ECDSA P-256 or RSA-2048 only when a service, standard, or piece of software you don't control specifically requires one of them for compatibility — for example, an older system that doesn't support Ed25519 keys yet.
Can I use this for SSH?
Yes. Generate a key pair, then copy the OpenSSH public key line into the target server's authorized_keys file, and keep the PEM private key to configure in your SSH client. Ed25519 is a common, well-supported choice for SSH keys on modern systems.
Why is RSA slower to generate than Ed25519?
RSA key generation involves searching for two large random prime numbers and combining them, which is computationally heavier the larger the key gets — a 2048-bit RSA key takes noticeably longer to generate than an elliptic-curve key of equivalent or stronger security. Ed25519 and ECDSA P-256 use different math (elliptic curves) that produces small, strong keys almost instantly by comparison.
What's the difference between the PEM public key and the OpenSSH line?
They encode the same public key in two different text formats. The PEM public key uses the SPKI format wrapped in a BEGIN PUBLIC KEY block, which is what most cryptographic libraries and certificate tooling expect. The OpenSSH line is the single-line format SSH itself uses, meant to be pasted directly into an authorized_keys file or given to a Git hosting service that asks for an SSH key.
Can I use the same key pair for both signing and SSH?
The key material is the same regardless of what it's used for, but the two use cases expect different file formats: SSH wants the OpenSSH public key line and the PEM private key configured in your SSH client, while signing tools (or JWTs using RS256/ES256) typically expect the PEM private key (PKCS#8) and PEM public key (SPKI) directly. This tool gives you all three outputs from one generation, so you can use whichever format the destination expects.
What happens to my key when I close the tab?
It's gone. Nothing is stored on a server, in a database, or in any account tied to you — the key pair exists only in your browser tab's memory for as long as the page stays open. Copy or download the private key before closing the tab, because there's no way to regenerate the exact same key pair afterward.