WiFi QR Code Generator

Published Updated

Enter a network name, a password and the security type to get a QR code that offers to join the Wi-Fi when a phone camera scans it. Save it as a PNG of 100 to 1,000 px or as an SVG.

One line of text in the code

A Wi-Fi QR code stores one line in the WIFI: format documented by the ZXing project, in a section headed for Android and iOS 11 and later. A guest network named Cafe Guest with the password latte;art:2026 becomes WIFI:T:WPA;S:Cafe Guest;P:latte\;art\:2026;;. T is the security type, S the name, P the password and H:true marks a hidden network.

The format treats backslash, semicolon, comma, colon and double quote as syntax, so the tool puts a backslash before each of them in the name and the password, as the ZXing notes require. Everything else goes in unchanged.

The three security choices

Menu optionWritten asPassword in the code
WPA/WPA2/WPA3 (default)T:WPAYes, as typed
WEPT:WEPYes, as typed
None (open network)T:nopassNo P: field; the password box is hidden

Enterprise networks that sign in with a username, which ZXing writes as WPA2-EAP, are not offered.

How the WPA3 Specification writes the same line

The Wi-Fi Alliance WPA3 Specification (version 4.0, section 8; published on the Wi-Fi Alliance Website) defines the same WIFI: scheme. Its rule puts the fields in a fixed order: T, an optional R for transition disable, S, H:true, an optional I for a password identifier, P, and K for a public key, then a closing semicolon. The tool writes T, S, H:true and P in that order, which ZXing, reading fields in any order, accepts as well.

Two details differ between the documents. The specification percent-encodes a semicolon and any byte outside its printable range, where ZXing and this tool put a backslash before \ ; , : and " and write other characters as plain UTF-8. And the specification marks an open network by leaving T out and defines T:WPA for password networks, with no WEP; the tool writes T:nopass and T:WEP from ZXing's list.

Codes decoded back, byte for byte

Each code below was typed into the tool's own fields in Google Chrome 157, Firefox 155 and Playwright's WebKit build (not the Safari app), downloaded as PNG and as SVG, and decoded with jsQR 1.4.0. In all three browsers both files held exactly the line shown, in UTF-8, at error-correction level M as read from the code's own format bits, and with no ECI segment naming a character set. Measured line by line:

Typed: name / passwordSecurityLine stored in the codeQR version (modules)
Cafe Guest / latte;art:2026WPA/WPA2/WPA3WIFI:T:WPA;S:Cafe Guest;P:latte\;art\:2026;;3 (29)
back\slash;semi,comma:colon"quote / p\;,:"wWPA/WPA2/WPA3WIFI:T:WPA;S:back\\slash\;semi\,comma\:colon\"quote;P:p\\\;\,\:\"w;;5 (37)
Lobby 2 with two spaces before and after / pass word with a space before and afterWPA/WPA2/WPA3WIFI:T:WPA;S:Lobby 2;P: pass word ;; (name trimmed, password kept)3 (29)
Café Ñandú / contraseñaWPA/WPA2/WPA3WIFI:T:WPA;S:Café Ñandú;P:contraseña;;, 42 bytes3 (29)
Guest 📶 / 🍕pizza🍕WPA/WPA2/WPA3WIFI:T:WPA;S:Guest 📶;P:🍕pizza🍕;;, 41 bytes3 (29)
CAFE / DEADBEEFWPA/WPA2/WPA3WIFI:T:WPA;S:CAFE;P:DEADBEEF;; (no quotes added)3 (29)
Office / emptyWPA/WPA2/WPA3WIFI:T:WPA;S:Office;P:;;2 (25)
OldRouter / ABCDEWEPWIFI:T:WEP;S:OldRouter;P:ABCDE;;3 (29)
Open Lobby / secret typed, then None chosenNoneWIFI:T:nopass;S:Open Lobby;; (the typed password is left out)3 (29)
Hidden Lab / h1dden, hidden tickedWPA/WPA2/WPA3WIFI:T:WPA;S:Hidden Lab;H:true;P:h1dden;;3 (29)
Open Hidden, hidden tickedNoneWIFI:T:nopass;S:Open Hidden;H:true;;3 (29)
A 32-character name / a 63-character password with ; , : \ and "WPA/WPA2/WPA3117 bytes with the escapes7 (45)

PNG size for each slider value

For the Cafe Guest line, a version 3 code whose 29 modules plus a 4-module margin on each side make 37. The pixel sizes were the same in all three browsers; the bytes depend on each browser's PNG encoder.

Size sliderPNGPixels per modulePNG bytes: Chrome 157 / Firefox 155 / the WebKit build
100111 x 11131,622 / 1,368 / 1,484
150148 x 14842,078 / 2,065 / 1,856
200185 x 18552,571 / 3,108 / 2,229
300 (default)296 x 29684,201 / 5,707 / 3,683
500518 x 518148,762 / 12,536 / 7,892
1,000999 x 9992725,289 / 28,094 / 22,588

The SVG keeps the slider value as its width and height, with a viewBox of 0 0 37 37. At the default size, error correction L and M fit this line in version 3, Q needs version 4 (33 modules, a 287 px PNG) and H version 5 (37 modules, 315 px). With the margin at 0 the PNG is 290 px, 10 px per module.

Making a code for guests

  1. Step 1

    Type the network details

    Type the name exactly as the router shows its SSID. The password field is plain text, so check it as you type.

  2. Step 2

    Pick security and style

    Choose WPA/WPA2/WPA3, WEP or None, tick Hidden if the network does not broadcast its name, then set colors, size and margin.

  3. Step 3

    Test, then save

    Scan the preview with your own phone, then download a PNG or SVG, or copy the SVG code.

What the tool does not check

  • Leading and trailing spaces in the name are removed, while the password is used exactly as typed. A network whose name really ends in a space will not match.
  • No length or character rules. A WPA option with an empty password field still produces a code; the phone finds out when it tries to join.
  • Names that look like hex. ZXing asks for double quotes around an ASCII name that could be read as hex, such as ABCD. The tool adds none and escapes any quotes you type, so test a name like CAFE or BEEF1234 before printing.
  • Contrast. Any foreground and background color is accepted, including pairs that are hard to scan.

Size, margin and error correction

The slider asks for 100 to 1,000 px in steps of 10, with 300 as the default, and the PNG comes out at the nearest size that gives every module the same whole number of pixels (the line under the slider shows it); for a printed sign the SVG scales to any size without blurring. The margin slider runs from 0 to 4 modules. Denso Wave's QR code guide says a four-module margin is required on every side, so keep the default of 4.

Error correction starts at M, which Denso Wave puts at about 15% restored and calls the most frequently selected level; for a sign that may get dirty or scratched it suggests Q or H. To read back a printed code, point QR Code Scanner at it. For links, plain text or other payloads, use QR Code Generator.

Wi-Fi QR code questions

Does a Wi-Fi QR code expire?

No. It holds fixed text, so it works for as long as the network name and password stay the same. Change either one on the router and the old code stops connecting, so print a new one.

Can someone read my Wi-Fi password from the code?

Yes. The password sits in the code as plain text, and any QR reader app shows the full line, P: field included. Put a guest network on codes that hang in public places, not the network your own computers use.

Which option fits a WPA3 router?

WPA/WPA2/WPA3, which writes T:WPA. That is the value the WPA3 Specification itself defines for password networks: in its first example, a phone that supports WPA3-Personal might use SAE (WPA3) or PSK (WPA2), and one without it uses WPA2. ZXing's list (WEP, WPA, WPA2-EAP, nopass) has no separate WPA3 value either. The tool does not write the specification's R field, which can tell a phone to use SAE only, so scan the result with your own phone first, especially on a router set to WPA3 only.

Does it work for a hidden network?

Tick This is a hidden network and the code gains H:true right after the name, where the WPA3 Specification puts it: WIFI:T:WPA;S:Hidden Lab;H:true;P:h1dden;;. It tells the phone that the name is not broadcast. The name itself still has to be typed exactly.

Why does my phone not join after scanning?

The code holds exactly what was typed, so the usual cause is a small mismatch: a capital letter in the name, a wrong character in the password, or the wrong security type. Scan it with a QR reader to see the stored line and compare it with the router's settings.

Can I add a logo or change the colors?

Colors, yes; a logo, no. Any pair of colors is accepted, so scan the preview with your phone after changing them, and leave the margin at 4 modules.

Can the network name have accents, emoji or Chinese characters?

Yes. They are written as UTF-8 bytes without escaping: Café Ñandú with the password contraseña made a 42-byte line, and a name and password in Chinese characters a 40-byte one, and both decoded back byte for byte from the PNG and the SVG in Chrome 157, Firefox 155 and the WebKit build. The code carries no ECI marker naming the character set, so the reader on the phone has to assume UTF-8. Scan it before printing.

Why is the PNG 296 px when the slider says 300?

Every module gets the same whole number of pixels. A typical guest code is version 3: 29 modules plus 4 on each side for the margin, 37 in all, and 300 / 37 rounds to 8 px, so the PNG is 296 x 296. At 100 the PNG is 111 px (3 per module) and at 1,000 it is 999 px (27 per module). The SVG keeps the slider value.

How long can the name and password be?

The tool sets no limit of its own. A 32-character name with a 63-character password, 117 bytes with its escapes, made a version 7 code of 45 modules, 318 px wide at the default size, and it decoded back exactly in all three browsers.

Does the order of the fields matter?

Not to readers built on ZXing, whose notes say the order of fields does not matter. The WPA3 Specification's rule does fix an order, T, S, H, then P, and the tool writes the fields in that order.

Related Tools