WireGuard Config Generator
Generate wg-quick client and server configs with real X25519 keys. Nothing is uploaded or stored.
Client interface
Private key is required. Generate one or paste an existing key.
Address is required, for example 10.0.0.2/24.
wg0.conf
Generate a key pair to start
Or load an example. Keys are created in your browser with the Web Crypto random source.
Examples
Interface with two peers
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"] }] })[Interface] + two [Peer] blocks, PersistentKeepalive = 25 on the firstPeers render in input order with per-peer AllowedIPs and keepalive lines where set.
Optional DNS and MTU
generateWireGuardConfig({ interface: { privateKey: key, address: ["10.0.0.1/24"], dns: ["1.1.1.1"], mtu: 1420 }, peers: [] })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
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).
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.
Set DNS and MTU only if needed
Leave dns and mtu blank to omit those lines; set them to emit DNS = and MTU = entries.
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.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.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.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.