Generate a QR Code for Wi-Fi Network Credentials
Create a QR code that automatically connects devices to a Wi-Fi network when scanned. Covers the WIFI: URI format, WPA/WPA2/WPA3 and open network support, hidden SSIDs, and special character handling.
Detailed Explanation
QR Codes for Wi-Fi Networks
Wi-Fi QR codes allow users to connect to a wireless network by scanning instead of manually entering the SSID and password. This is supported natively on iOS (11+), Android (10+), and most modern devices.
The WIFI URI Format
Wi-Fi credentials are encoded using a standardized URI format:
WIFI:T:WPA;S:MyNetworkName;P:MyPassword123;;
The format fields are:
| Field | Description | Required |
|---|---|---|
T |
Authentication type: WPA, WEP, or nopass |
Yes |
S |
SSID (network name) | Yes |
P |
Password | Yes (except nopass) |
H |
Hidden network: true or false |
No (default: false) |
Security Types
- WPA/WPA2/WPA3 — Use
T:WPAfor all WPA variants. The device will negotiate the appropriate version automatically. - WEP — Use
T:WEP. Note that WEP is considered insecure and should be avoided. - Open Network — Use
T:nopassand omit thePfield:WIFI:T:nopass;S:GuestNetwork;;
Special Characters in SSID or Password
If the SSID or password contains special characters (;, ,, :, \, "), they must be escaped with a backslash:
WIFI:T:WPA;S:My\;Network;P:pass\:word123;;
Hidden Networks
For hidden networks that do not broadcast their SSID, set the H field to true:
WIFI:T:WPA;S:HiddenNet;P:secretpass;H:true;;
Best Practices
- Print the QR code near the router — Place it in a visible location for guests.
- Use WPA2 or WPA3 — Never use WEP or open networks for sensitive environments.
- Update the QR code when you change the password — An outdated QR code will fail silently when scanned.
- Consider a guest network — Generate a QR code for a separate guest network to keep your primary network secure.
- Test on both iOS and Android — Wi-Fi QR code support can vary between OS versions and manufacturer skins.
Use Case
Wi-Fi QR codes are used in hotels, coffee shops, co-working spaces, Airbnb rentals, conference venues, office reception areas, and retail stores. They eliminate the need to verbally communicate or print complex passwords, reducing support requests and improving the guest experience.