Lumen Lab 루멘랩

WiFi QR codes: format, special characters and hidden networks

Lumen Lab · Last checked

StaycodeQR code makerOpen

A WiFi QR code is a single line of text such as WIFI:T:WPA;S:Cafe Staycode;P:sun\:rise\;42;; stored in the image. When guests point their camera at it, the phone offers to join that network with that password. Enter the name and password in the WiFi QR code generator and the escaping is done for you. Because the password sits inside the image, changing it on your router means making and printing a new code.

What goes inside a WiFi QR code?

Four fields separated by semicolons. The format is documented on the ZXing wiki, and Staycode follows it exactly.

FieldMeaningExample
T:Security type: WPA, WEP or nopassT:WPA
S:Network name (SSID). RequiredS:Cafe Staycode
P:Password. Left out for nopassP:sun\:rise\;42
H:true for a hidden networkH:true

Swipe the table sideways

The line ends with two semicolons (;;). In this generator, routers using WPA, WPA2 or WPA3 are stored as WPA, and very old routers as WEP. The format also defines WPA2-EAP for enterprise networks where each person has their own login, but this tool does not create those.

What if the password has ; or : in it?

A backslash goes in front. Five characters, \ ; , : ", have a special meaning in the format, and left alone they would make a phone cut the password short. Here is what Staycode actually stores:

Router passwordStored in the code
sun:rise;42P:sun\:rise\;42;
abc;123P:abc\;123;
moon,lightP:moon\,light;
say"hi"P:say\"hi\";
p@ss,word\1P:p@ss\,word\\1;

Swipe the table sideways

Type the password exactly as it is on your router and do not add backslashes yourself. The same rule applies to network names. If a WPA password is not 8 to 63 characters, or the name is longer than 32 bytes, the generator asks you to double-check it against the router.

Hidden networks and open networks

Tick "Hidden network" and H:true; is added. It tells the phone to look for that name even though it does not appear in the list.

WIFI:T:WPA;S:Back Office;P:p@ss\,word\\1;H:true;;

For a network with no password, set Security to "None" and the P: field disappears.

WIFI:T:nopass;S:Guest;;

How do iPhone and Android phones connect?

According to the ZXing wiki, the built-in cameras on Android and on iOS 11 and later read this format. Usually a "Join network" prompt appears when the camera sees the code, and tapping it connects without typing the password. The exact prompt can look different by model and version. On a phone whose camera cannot read it, use a QR app or the QR code scanner to read the code and copy the password.

Do I need a new code after changing the password?

Yes. A WiFi code is a static code, so the password lives in the image. Once you change it on the router, the old code will not connect. A separate guest network helps here: put only the guest password in the code, and you can change it without touching your own devices.

Tips for a sign at your venue

  • Size: using the rule of thumb that a code scans from about 10 times its own width, a code on a table scanned from 30 to 50 cm (12 to 20 in) needs a pattern about 3 to 5 cm (1.2 to 2 in) wide, and one on the wall behind a counter, scanned from about 1 m (3 ft), about 10 cm (4 in). See QR code print size for the full table.
  • Label it: pick the "JOIN WI-FI" frame text so people know what the code is for.
  • Print the details too: write the network name and password next to the code for guests whose camera cannot read it.
  • Test before you print: name and password must match the router exactly, including capitals and spaces. Scan the code with your own phone and join once.

The password is processed in your browser only. It is not sent anywhere, not put in the page address, and WiFi codes are never kept in "Recent QR codes".

Make a WiFi QR code

Sources

Found a mistake, or a rule that has changed? Email contact@lumenlab.page. We check it, fix it and put the new date on this guide.