How can a QR code connect a phone to WiFi?
A QR code is just a picture that stores text. When a phone's camera app reads text that starts with WIFI:, it treats it as WiFi login details and offers to join that network. The format became widespread through the ZXing barcode library on Android, and current iOS and Android camera apps understand it. The string this generator builds has the following parts.
WIFI:marks the code as WiFi information.S:name;is the SSID, the network name.T:WPA;is the security type: WPA, WEP or nopass. Routers running WPA2 or WPA3 are normally joined with the valueWPA.P:password;is the password, left empty for an open network.H:true;is added only for a hidden network.- A final
;closes the string.
A complete example is WIFI:S:HomeWiFi_5G;T:WPA;P:myPassw0rd2024;;, which is 43 characters long. The tool only builds this string and draws it as a QR image. Below the result it also shows the same string with the password replaced by asterisks, so you can compare it with what your phone shows after scanning.
How special characters are handled
The characters ; : , " and \ act as separators inside the string. If your network name or password contains one of them, it must be preceded by a backslash so that it is read as a literal character. The tool does this for you.
| What you type | Feature | What goes into the QR |
|---|---|---|
Cafe;Free | contains a semicolon | Cafe\;Free |
My:Wi,Fi | contains a colon and a comma | My\:Wi\,Fi |
pass"word | contains a double quote | pass\"word |
a\b | contains a backslash | a\\b |
Spaces at the start or end of the password are kept as part of the password, but spaces around the network name are trimmed because they are usually typing mistakes. Spaces in the middle of a name are kept.
Choosing a size and error correction level
The more text a QR code holds, the more squares (modules) it has, and the higher the error correction level, the more of the code can be damaged or covered while it still scans, at the cost of a denser pattern. The nominal recovery capacity is about 7% for L, 15% for M, 25% for Q and 30% for H. The table shows the size produced by this page's QR library for the same WiFi details (version number and squares per side).
| Example | Characters | L | M | Q | H |
|---|---|---|---|---|---|
| Short name + 8 digits | 30 | v2 (25x25) | v3 (29x29) | v3 (29x29) | v4 (33x33) |
| Typical home network (11-char name, 14-char password) | 43 | v3 (29x29) | v3 (29x29) | v4 (33x33) | v5 (37x37) |
| Cafe guest network (23-char name, 30-char password) | 71 | v4 (33x33) | v5 (37x37) | v6 (41x41) | v8 (49x49) |
| Maximum (32-char name, 63-char password) | 113 | v5 (37x37) | v6 (41x41) | v8 (49x49) | v10 (57x57) |
For a code shown on a screen, the default M is enough. For a printout on a router or a cafe table, where it can get creased, scuffed or hit by glare, choose Q or H, and print it at least 3 cm square, ideally 4 to 5 cm, because the finer pattern needs more room. Do not crop the white margin around the code, since scanners rely on it.
Worked example: how length changes the code
Example 1: the name HomeWiFi_5G (11 characters) and the password myPassw0rd2024 (14 characters) make a 43-character string, which at level M is version 3, a 29 x 29 grid. Example 2: a 32-character name with a 63-character password, the longest a router accepts, makes 113 characters and becomes version 6, a 41 x 41 grid at level M. If both are printed at the same physical size, the squares of the second one are smaller, so a long password is a good reason to print larger.
How passwords are validated
A WPA or WPA2 personal passphrase is 8 to 63 characters (or a 64-digit hexadecimal key), and routers reject anything outside that range, so the tool warns you when a WPA password is shorter than 8 characters. For WEP, keys are customarily 5 or 13 ASCII characters (10 or 26 hex digits), and the tool asks you to double-check other lengths. For an open network the password is ignored. These checks are there to catch typos; your router's actual settings are what matters.
One more detail: the SSID limit is 32 bytes, not 32 characters, so names with accented or non-Latin letters hit the limit earlier. WPA passphrases are defined as ASCII characters in the 802.11 specification, so sticking to ASCII is the safe choice. The ZXing documentation also suggests wrapping a name or password in double quotes when it consists only of hex-looking characters such as ABCD. This tool does not add quotes automatically, so if a value made only of digits and A to F fails to connect, a device-specific difference in interpretation is a likely cause.
Is this handled safely?
The name and password you enter are turned into a QR code inside your browser. The page uses a QR library that runs locally and makes no network request with your details, so nothing is sent to a server or stored. The QR image itself, however, contains the password in plain text, with no encryption. Anyone who can scan it can read the password, so a few habits are worth following.
- Do not post the QR for your main network in a public place. Set up a separate guest network on your router (most have one) and share only that.
- Sending the image through a messaging app or email leaves the password in that history. Send it only to people who need it and change the password periodically if it is for visitors.
- The downloaded file name does not contain your SSID or password, but the image is the password, so do not leave it in an automatically backed-up photo folder.
- If you change the password, every QR you made earlier stops working. Print a fresh one to replace old copies.
Troubleshooting when the scan fails
- Check that your camera app has QR scanning enabled. Some phones have it switched off in the camera settings.
- Check the security type. WPA3-only (SAE-only) settings and enterprise networks that use a username and password may not be representable in this format, or may behave differently by device. Setting the router to WPA2/WPA3 mixed mode often solves it.
- Hidden SSID: if the network is hidden and you did not tick the box, the connection will fail. Ticking it for a visible network is usually harmless but unnecessary.
- Check special characters and capitalization. Passwords are case-sensitive, and the name might contain a space you cannot see.
- Print quality: scan from 20 to 30 cm in good light. If the print is blurry or small, raise the error correction to Q or H and print it larger.
- If it still fails, copy the text your phone shows after scanning and compare it with the connection string on this page.
Common misunderstandings and limits
- "The password is hidden when scanned, so it is safe" is wrong. Once saved on a device it may not be displayed, but decoding the QR reveals it in plain text.
- It does not replace devices that are already connected. The scan only saves a new device from typing the details.
- Connecting to WiFi from a QR code of unknown origin in a public place can be risky, because fake networks exist. Only scan codes you trust.
- If you need a QR for a link or plain text, use the QR Code Generator.
- A weak password is a bigger problem than the QR itself. The Password Generator can make a long random one, and the Password Strength Checker can help you judge an existing one.
Putting the code to use
For guests at home, frame the code near the entrance or in the living room and tell visitors to open their camera and point it at the code, so nobody has to read out a password. For a shop, print the network name next to the code so devices that cannot scan can still be set up by hand. Devices with no camera, such as TVs, printers and smart speakers, need the details typed on the device itself. Whenever you replace the router or change the password, generate a new code and swap the old printout.
Frequently Asked Questions
Will every smartphone recognize it?
Most current default camera apps on iOS and Android recognize it automatically. Some older devices or customized camera apps may need a separate QR scanner, and laptops or TVs without a camera need manual entry.
How is this different from a regular QR code generator?
A regular QR code holds a URL or text. This one holds the WiFi login format, so a connection prompt appears right after scanning. It also escapes special characters and marks hidden networks for you.
Which security type should I choose for a WPA3 router?
Most WPA3 routers also run WPA2 in a mixed mode, so choose "WPA/WPA2/WPA3". Support for WPA3-only mode varies by device; if scanning does not connect, try switching the router to mixed mode.
Do I need to remake the QR code when I change the password?
Yes. The code contains the password as it was when you generated it, so any change to the password or the network name needs a new code.
How do I set up a hidden network?
Tick "Hidden network". The string then contains H:true, which tells the scanning device to look for a network that does not broadcast its name.
Where does the downloaded image go?
The PNG (wifi-qrcode-playinfobox.png) goes to your browser's default download folder. It is created on your own device and does not pass through a server.