Wi-Fi QR codes: the WIFI:T:WPA;S:…;P:…;; format, escaping, and why yours won't connect
A Wi-Fi QR code is not magic: it is one short line of text that phone cameras recognise and turn into a <i>Join network</i> button. Knowing the format makes it easy to build one by hand, debug one that fails, and decide whether it is safe to print.
The format, field by field
WIFI:T:WPA;S:Cafe Guest;P:latte2026;H:false;;
│ │ │ │ └ end: an empty field, so the line ends ;;
│ │ │ └ H hidden network? true / false (optional)
│ │ └ P password (omit for open networks)
│ └ S SSID, the network name, exactly as broadcast
└ T security: WPA (covers WPA2/WPA3), WEP, or nopass
| Field | Values | Notes |
|---|---|---|
T | WPA, WEP, nopass | Use WPA for WPA, WPA2 and WPA3 personal networks. Phones negotiate the version with the router. Some newer phones also read SAE, but WPA is the safe choice. |
S | network name | Case-sensitive. A trailing space or a curly apostrophe (’ instead of ') makes it a different network. |
P | password | Leave the field out entirely when T:nopass. WPA passwords are 8–63 characters. |
H | true | Only for routers that hide their name. Harmless to omit otherwise. |
The field order does not matter to most readers, but T, S, P, H is what Android itself produces when you share a network.
Escaping special characters
Because ; separates fields and : separates a field name from its value, these five characters must be preceded by a backslash when they appear in the name or password:
\ ; , : "
Password: pa;ss:wo,rd"1
In the QR: WIFI:T:WPA;S:Home;P:pa\;ss\:wo\,rd\"1;;
Forgetting to escape is the top reason a home-made code “scans but will not connect”: the phone reads a truncated password. The generator escapes for you and shows the final text under What is inside the code. Some older readers also get confused by a password made only of hex digits (like DEADBEEF); wrapping it in double quotes, P:"DEADBEEF";, is the documented workaround.
Scanning it
- iPhone / iPad (iOS 11+): open the Camera app, point at the code, tap Join “network”.
- Android (10+): Camera app, Google Lens, or the QR scanner tile in Quick Settings; tap Connect. To go the other way, Settings → Network → Wi-Fi → tap your network → Share shows a QR for a network you are already on.
- Laptops: Windows and macOS cameras do not join Wi-Fi from a QR; type the password there.
Fix table: the code scans but will not connect
| Symptom | Likely cause | Fix |
|---|---|---|
| “Unable to join network” | Password has an unescaped ; , : \ " | Regenerate with a tool that escapes, and check the decoded text |
| Phone looks for a network that is not there | SSID mismatch (capitals, trailing space, ’ vs ') | Copy the name from the router admin page, not from memory |
| Works on Android, fails on iPhone (or vice versa) | Non-standard T value such as WPA2 or SAE | Use T:WPA |
| Nothing happens on scan | Code too small, low contrast or no white border | Print bigger, dark on light, keep a 4-module quiet zone. See QR code not scanning |
| Joined, but no internet | Not a QR problem | Captive portal, MAC filtering or DHCP; check the router |
| Stopped working after months | Password or SSID changed | Make a new code; the old one holds the old password |
Is it safe?
The password sits inside the code in plain text, so anyone who photographs the printed code can join and any QR app can display the password. That is fine for a café or a guest network; it is the same as writing the password on a card. Two habits help:
- Use a separate guest network for the code, so it never unlocks the network your laptop, NAS or cameras are on.
- Generate the code locally. Many “free QR” sites send what you type to their server; this site draws the code in your browser so the password is never uploaded. Need a strong new guest password first? Use the password generator.
Want to send a password to one person rather than print it? A one-time link that burns after reading, such as Fusenote, avoids leaving it in chat history.
Related
Read a Wi-Fi QR code from a screenshot (and see its password) · Find a saved Wi-Fi password · 2.4 GHz vs 5 GHz · Connected but no internet · Contact card (vCard) QR codes · QR code not scanning / error correction · QR code generator
Questions
What text is inside a Wi-Fi QR code?
A single line such as WIFI:T:WPA;S:NetworkName;P:Password;; where T is the security type, S the network name, P the password and the line ends with two semicolons.
Should I use WPA, WPA2 or WPA3 for T?
Write WPA. It covers WPA, WPA2 and WPA3 personal networks; values like WPA2 are not part of the format and fail on some phones.
How do I put a semicolon in a Wi-Fi QR password?
Escape it with a backslash: \; — the same for comma, colon, backslash and double quote.
Can a Wi-Fi QR code be hacked?
The code simply contains the password, so it is as secret as a card with the password written on it. Use a guest network and print it only where you would share the password anyway.
Do Wi-Fi QR codes expire?
No. They stop working only when the network name or password changes.
Can I make one without uploading my password?
Yes. Tooltern's Wi-Fi QR generator builds the code in your browser; the password is never sent anywhere.
Published · updated .