DevTools Logo

WireGuard Config Generator

WireGuard Config Generator

Build deterministic client and server .conf files entirely in your browser

Client interface

About

Generate WireGuard client or server .conf files in your browser. Validate IPv4 and IPv6 CIDR ranges, 44-character base64 keys, optional PersistentKeepalive, DNS, MTU, and listen ports without uploading secrets.

Examples

Interface with two peers

Input
generateWireGuardConfig({ interface: { privateKey: key, address: ["10.0.0.1/24"] }, peers: [{ publicKey: key, allowedIPs: ["0.0.0.0/0"], persistentKeepalive: 25 }, { publicKey: key, allowedIPs: ["10.10.0.0/16"] }] })
Output
[Interface] + two [Peer] blocks, PersistentKeepalive = 25 on the first

Peers render in input order with per-peer AllowedIPs and keepalive lines where set.

Optional DNS and MTU

Input
generateWireGuardConfig({ interface: { privateKey: key, address: ["10.0.0.1/24"], dns: ["1.1.1.1"], mtu: 1420 }, peers: [] })
Output
DNS = 1.1.1.1 + MTU = 1420 under [Interface]

DNS and MTU lines appear only when provided; omitting them leaves a minimal interface block.

About this tool

WireGuard Config Generator validates and renders wg-quick style configs with generateWireGuardConfig(config): the [Interface] section emits the trimmed PrivateKey, one Address line per CIDR, and optional DNS, MTU, and ListenPort lines only when set, followed by one [Peer] block per peer in input order with its PublicKey, AllowedIPs, and optional PresharedKey, Endpoint, and PersistentKeepalive.

Validation is explicit via validateWireGuardConfig and the isValidCIDR/isValidWireGuardKey helpers: keys must match 44-character base64 decoding to exactly 32 bytes, CIDRs must be well-formed IPv4 (/0–/32 with octets 0–255) or IPv6 (/0–/128, at most one ::), and PersistentKeepalive must be an integer 0–65535. Each failure returns a field-tagged issue such as peers.0.allowedIPs.0.

An optional generateWireGuardKeyPair derives an X25519 pair via WebCrypto and returns base64 keys, or null where unsupported. Generation is deterministic string building in the browser — keys and endpoints never leave the device.

How to use this tool

  1. Enter interface keys and addresses

    Provide a 44-character base64 private key and one CIDR per Address line (e.g. 10.0.0.1/24).

  2. Add peers in order

    Add each peer's public key and AllowedIPs, plus optional endpoint, preshared key, and keepalive — blocks render in the order listed.

  3. Set DNS and MTU only if needed

    Leave dns and mtu blank to omit those lines; set them to emit DNS = and MTU = entries.

  4. Validate and copy the config

    Check the field-tagged issues list, then paste the output into wg0.conf and bring it up with wg-quick.

Use cases

Scaffolding road-warrior configs

Render client configs with 0.0.0.0/0 peers, endpoints, and keepalives for NAT traversal.

Linting pasted keys and CIDRs

Catch malformed base64 keys and out-of-range prefixes via field-tagged issues before deploying.

Generating site-to-site peers

List multiple peers with per-site AllowedIPs in a fixed order for repeatable configs.

Common mistakes

Mistake:Using a key that looks right but is not 44-char base64.

Fix:Keys must match /^[A-Za-z0-9+/]{43}=$/ and decode to 32 bytes — short strings and URL-safe alphabets fail isValidWireGuardKey.

Mistake:Writing an IPv4 prefix above /32.

Fix:10.0.0.0/44 is rejected — IPv4 prefixes clamp to 0–32 and IPv6 to 0–128, with at most one :: in v6 addresses.

Mistake:Expecting DNS/MTU/keepalive lines to always appear.

Fix:DNS, MTU, and PersistentKeepalive emit only when set — an unset keepalive (undefined) leaves no line, and 0 validates as in-range.

Frequently asked questions

What does this tool do?

It validates and renders wg-quick configs with generateWireGuardConfig: an [Interface] block (PrivateKey, Address lines, optional DNS/MTU/ListenPort) plus one [Peer] block per peer in input order, with validateWireGuardConfig reporting field-tagged issues.

What key and CIDR rules apply?

Keys must be 44-character base64 decoding to exactly 32 bytes; IPv4 CIDRs need octets 0–255 with prefix 0–32, IPv6 needs prefix 0–128 with at most one ::. PersistentKeepalive must be an integer 0–65535.

Is my key material uploaded or stored?

No. Validation, rendering, and optional X25519 key-pair generation via WebCrypto all run in your browser — keys and endpoints never leave your device.

When do DNS, MTU, and keepalive lines appear?

Only when set: blank DNS/MTU are omitted, and an unset (undefined) PersistentKeepalive leaves no line. A keepalive of 0 is valid and in-range.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML