Free tool, no account

WireGuard key generator

A private key, its public key and a preshared key, made by your browser's own crypto (WebCrypto X25519) and never sent anywhere. Already have a PrivateKey? The second box tells you which public key the other side must list.

New key pair and preshared key

Which public key goes with this private key?

Paste a PrivateKey from a .conf file. The public key computed here is the one the other side must list; if it lists another one, the handshake never completes.

Prefer your own machine? The same three commands

On the server, keys made locally never leave it. These give exactly the same format as this page: 32 bytes, base64, 44 characters.

umask 077
wg genkey | tee privatekey | wg pubkey > publickey
wg genpsk > presharedkey

On Windows, the WireGuard app writes a new PrivateKey when you click "Add empty tunnel" and shows its public key above the editor.

Where each key goes

PrivateKey
In the [Interface] of the device it belongs to, and nowhere else. One per device: two clients sharing a key keep knocking each other off the tunnel.
PublicKey
In the [Peer] section of the other side. The server lists each client's public key, each client lists the server's.
PresharedKey
Optional, one per pair: the identical value in the server's [Peer] for that client and in the client's [Peer] for the server. It adds a symmetric layer on top of X25519 (WireGuard's answer to future quantum attacks). If only one side has it, or the values differ, the handshake fails without an error message.

Keys made, handshake still not coming?

Paste the server and client files in the pair checker: it derives both public keys and shows which side lists the wrong one, a missing PresharedKey or a port that does not match. To skip the copy and paste for good, WireGuard Manager generates keys, PSK and QR codes for every peer (free for 1 server and 3 peers).

Create a free account