Overview
WiFi QR codes allow users to connect to wireless networks instantly by scanning a code, without manually typing network names and passwords. Most modern smartphones automatically detect WiFi QR codes and prompt the user to join the network. This is especially useful for guest networks, businesses, cafes, and events.Data Structure
WiFi QR codes use theWifiQrData interface:
The network name (SSID - Service Set Identifier). Must be 1-32 characters in length.
The network password. Required for WPA and WEP security types. Minimum 8 characters for WPA, 5 characters for WEP. Maximum 63 characters. Leave empty for open networks (nopass).
The network security type:
"WPA": WPA/WPA2/WPA3 encrypted networks (most common)"WEP": WEP encrypted networks (legacy, not recommended)"nopass": Open networks without password protection
Encoding Format
WiFi QR codes use a standardized format (from/src/domain/encoders/encoders.ts:25-28):
Format Specification
The WiFi QR code format follows this structure:T:- Authentication type (WPA, WEP, or nopass)S:- Network SSID (name)P:- Network password (empty for open networks);;- Terminator
Example Encoding
| Input | Encoded Output |
|---|---|
| SSID: “MyNetwork” Password: “secret123” Security: “WPA” | WIFI:T:WPA;S:MyNetwork;P:secret123;; |
| SSID: “GuestWiFi” Security: “nopass” | WIFI:T:nopass;S:GuestWiFi;P:;; |
| SSID: “Office-5G” Password: “password” Security: “WEP” | WIFI:T:WEP;S:Office-5G;P:password;; |
Validation Rules
The validator (from/src/domain/validation/validators.ts:71-96) enforces these requirements:
SSID Requirements
SSID Requirements
- Cannot be empty or whitespace only
- Maximum length: 32 characters (WiFi standard)
- Error messages:
- “El SSID es obligatorio”
- “El SSID no puede tener más de 32 caracteres”
Password Requirements (WPA)
Password Requirements (WPA)
For
security: "WPA":- Password is required (cannot be empty)
- Minimum length: 8 characters
- Maximum length: 63 characters
- Error messages:
- “La contraseña es obligatoria para redes con seguridad”
- “La contraseña WPA/WPA2 debe tener al menos 8 caracteres”
- “La contraseña no puede tener más de 63 caracteres”
Password Requirements (WEP)
Password Requirements (WEP)
For
security: "WEP":- Password is required (cannot be empty)
- Minimum length: 5 characters
- Maximum length: 63 characters
- Error messages:
- “La contraseña es obligatoria para redes con seguridad”
- “La contraseña WEP debe tener al menos 5 caracteres”
- “La contraseña no puede tener más de 63 caracteres”
Open Network (nopass)
Open Network (nopass)
For
security: "nopass":- Password is not required and will be ignored in encoding
- No password validation is performed
Validation Implementation
Usage Example
Common Use Cases
- Guest Networks: Provide easy WiFi access for visitors
- Businesses: Share network credentials with customers (cafes, restaurants, hotels)
- Events: Allow attendees to connect quickly at conferences or gatherings
- Offices: Simplify onboarding for new employees
- Home Networks: Share WiFi with guests without revealing the password verbally
Security Considerations
- Use WiFi QR codes only for guest networks or networks you intend to share publicly
- Consider using a separate guest network isolated from your main network
- For WPA networks, ensure you’re using WPA2 or WPA3 on your router
- Avoid using WEP encryption as it’s outdated and insecure
- Regularly rotate guest network passwords