A WiFi QR code is just text in a fixed format: WIFI:T:WPA;S:mynetwork;P:mypass;;. T is the security type, S is the network name (SSID), P is the password, and an optional H:true marks a hidden network. If the name or password contains a backslash, semicolon, comma, double quote or colon, each of those characters needs a backslash in front of it, or the code can fail to connect. The format is documented in the ZXing project's wiki and is read by Android and iOS 11 or later.
The format
The ZXing "Barcode Contents" wiki (updated October 16, 2026) describes it as a syntax "like MECARD" for WiFi. Its example is:
WIFI:T:WPA;S:mynetwork;P:mypass;;
| Field | Example | Meaning |
|---|---|---|
| T | WPA | Security type: WEP, WPA, WPA2-EAP, or nopass for no password. Or leave it out for no password. |
| S | mynetwork | Network name (SSID). Required. |
| P | mypass | Password. Ignored if T is nopass. |
| H | true | Optional. True if the network is hidden. |
The order of fields doesn't matter, and the string ends with two semicolons. The ZXing wiki labels this WiFi format as working on Android and iOS 11 or later.
Examples
- Normal network:
WIFI:T:WPA;S:CornerCafeGuest;P:tulip47crisp;; - Hidden network:
WIFI:T:WPA;S:HomeNet;P:tulip47crisp;H:true;; - Open network, no password:
WIFI:T:nopass;S:Library;;
Special characters
ZXing says the characters \, ;, ,, " and : "should be escaped with a backslash". Its example: if the network name is literally "foo;bar\baz" with the double quotes as part of the name, it is encoded as WIFI:S:\"foo\;bar\\baz\";;.
So a password like tulip;crisp:47 is written P:tulip\;crisp\:47. Our WiFi QR code generator adds those backslashes for you and encodes the password in your browser, so it isn't sent to us. If you make codes by hand or with another tool, check whether the tool does the same.
Names and passwords made only of digits or hex letters
ZXing also says to enclose the SSID or password in double quotes "if it is an ASCII name, but could be interpreted as hex (i.e. "ABCD")". For example, a network named 1234 or a password ABCDEF can be mistaken for a hex value, so write S:"1234". If a code works for most names but fails for one with only digits, this is a likely cause. Test it on your own phone.
If your WiFi code won't connect
- Scan the code with a plain text QR reader or your camera and read the text. Is it in the
WIFI:format? - Check the network name and password for the five special characters above.
- Check T. Use
WPAfor a typical home network with a password (it is what our generator writes) andnopassfor an open network. The wiki lists only WEP, WPA, WPA2-EAP and nopass. - For a hidden network, add
H:true. - If you changed the password after printing, the code holds the old one. Make a new code and replace the sign: see WiFi QR code for guests.
- Scan again on two different phones.
How to scan one on a phone: How to scan a WiFi QR code on iPhone and Android.
Common questions
What is the format of a WiFi QR code?
WIFI:T:<type>;S:<name>;P:<password>;;, with optional H:true for a hidden network.
Which characters need escaping in a WiFi QR code?
Backslash, semicolon, comma, double quote and colon, each with a backslash in front.
Can a WiFi QR code hold a hidden network?
Yes, add H:true.
Does a WiFi QR code work on iPhone?
The ZXing wiki lists the WiFi format for Android and iOS 11 or later.
Sources: the ZXing project's "Barcode Contents" wiki page (updated October 16, 2026), checked December 5, 2026. The generator behaviour described is from Scanstone's own code and tests.