Sharing Wi-Fi with a QR code: a worked example
Task and input
The goal is a QR code that a guest's phone can read to get the details of a Wi-Fi network. This example uses a fictional network, not a real one: SSID Guest Lab, password demo-guest-2026, WPA authentication. Anyone who can scan or photograph the finished code can read the password inside it, so treat it as visible sharing, not a protected secret.
The common interchange convention for Wi-Fi QR codes, documented in the ZXing Barcode Contents wiki (https://github.com/zxing/zxing/wiki/Barcode-Contents), starts with WIFI: and uses these fields: T is the authentication type, S is the SSID (network name), P is the password, and H is the hidden-network flag. For our input, the expected payload is: WIFI:T:WPA;S:Guest Lab;P:demo-guest-2026;; The example leaves out H. Add it only if the network is actually configured as hidden.
Worked steps
Step 1: Choose the input type and supply the values. The tool is designed with separate Create and Read modes and URL, Text and Wi-Fi input buttons. In Create mode, pick Wi-Fi. The values to provide correspond to the payload fields: S is Guest Lab, T is WPA and P is demo-guest-2026. The design does not specify the exact layout of the Wi-Fi input, so follow the deployed interface for where each value goes. Enter the network name exactly as the network presents it.
Step 2: Check your expected payload before you generate the code. Write out the payload you expect, as shown in the Task and input section, and check spelling and the double semicolon at the end. Also check escaping: per the ZXing wiki, a backslash, semicolon, comma, double quote or colon inside a value must be preceded by a backslash. Neither Guest Lab nor demo-guest-2026 contains any of those characters, so no escaping is needed here. If an SSID were Lab;2, the field would be written S:Lab\;2. For an open network, the convention uses nopass as the type and omits the password.
Step 3: Generate and export. Encoding uses the JavaScript qrcode-generator library (https://github.com/kazuhikoarase/qrcode-generator). The tool bundles pinned release 1.4.4 and serves it locally, so the design needs no external runtime API. Export the result as PNG or SVG, depending on where you plan to display or print it.
Verify the result
First, decode your own export. Switch to Read mode, load the exported PNG from your computer and press Decode. By design, the file is processed locally rather than uploaded. Decoding uses jsQR (https://github.com/cozmo/jsQR), bundled as pinned version 1.4.0. jsQR reads RGBA pixel data together with the image width and height, and it returns the decoded data when it succeeds. The tool is designed to show the decoded contents literally, with Copy. It does not act on the contents automatically, for example by opening a URL.
Compare the decoded text character by character with the expected payload WIFI:T:WPA;S:Guest Lab;P:demo-guest-2026;; If anything differs, such as a missing semicolon, a changed character or a lost escape, fix the input and generate the code again. Do not try to edit the image.
Then test on the device you actually intend guests to use. Scan the code with that phone's camera or reader app and note what it does. It may offer to join the network, show the text, or do nothing useful. This guide includes no live device testing, and the ZXing wiki describes the format as a practical convention, not a guarantee for every reader. Keep the network name and password available in written form as a fallback.
Limits and common mistakes
A QR code is not encryption. The payload is plain text, and anyone who scans or photographs the code gets the password. Display it only where you would be comfortable writing the password itself. If the code spreads further than intended, change the password and generate a new code.
Common payload mistakes: special characters left unescaped; a password included for an open network instead of using nopass; the H flag set on a network that is not hidden, or missing on one that is; and a network name that does not exactly match the real one. Each of these produces a code that decodes cleanly but may not connect.
Decoding has limits too. jsQR may fail on an arbitrary photo of a code, so check the exported file first. A failed decode of a blurry or angled photo does not prove the code itself is wrong. The tool's scope is limited to URL, text and Wi-Fi codes and local image decoding; this guide covers Wi-Fi. It makes no claim about scan rates or specific brands of phones or apps.
Sources
ZXing, Barcode Contents: https://github.com/zxing/zxing/wiki/Barcode-Contents (Wi-Fi fields T, S, P and H; escaping rules; nopass; reader compatibility caveat).
qrcode-generator by Kazuhiko Arase: https://github.com/kazuhikoarase/qrcode-generator. Pinned release 1.4.4: https://registry.npmjs.org/qrcode-generator/1.4.4
jsQR: https://github.com/cozmo/jsQR. Pinned release 1.4.0: https://registry.npmjs.org/jsqr/1.4.0
Sources were captured on 2026-09-28 and have not been re-verified since. The Guest Lab network and its password are fictional examples created for this guide.