Why QR codes work
QR codes pack up to ~3,000 bytes (roughly 2,900 ASCII characters, fewer for non-ASCII or dense content) into a square matrix readable by any phone camera. They're self-correcting: up to 30% of the pattern can be damaged and a phone can still decode it — that's the error correction level built in.
Tips from the real world
- Don't print tiny: on paper, the QR should be ≥ 2 × 2 cm for scanning at arm's length; on a screen, ≥ 200 px.
- Wi-Fi QR encodes
WIFI:T:WPA;S:name;P:pass;;— phones scan and join instantly, no typing. - Test before printing! Phone cameras handle most, but some apps choke on unusual characters.
- For URLs use the full https:// form — scanners don't guess protocols.
Under the hood
gen() hands the payload to the QR library, which draws the symbol onto a canvas; switchType() swaps the input template between plain text, URL, Wi-Fi credentials and contact details, and wifiEscape() escapes the characters that would otherwise break the Wi-Fi string — semicolons, commas and backslashes in an SSID are the usual culprits. The canvas is then converted to a PNG data URL so the image can be saved or embedded.
Formats, sizes and other limits
Density grows with payload length: the same physical size holds more modules, and modules that are too small stop being scannable on older phone cameras. When the payload exceeds the library's capacity the page clears the image and reports it rather than showing an unreadable code. Only WPA, WEP and open networks are supported — enterprise 802.1X needs extra fields. Output is raster PNG only, and there is no logo overlay, because covering the centre eats the error-correction budget.
Privacy: nothing is uploaded
The symbol is drawn on a canvas in this tab. A Wi-Fi password you encode exists only inside the image, and nothing about the payload is transmitted.
Frequently asked questions
Why will my phone not scan it?
Usually density or print size. Shorten the payload or render it larger; a code that fills a business card is harder to read than one on a poster.
Can I add a logo in the middle?
Not here. Covering modules reduces the error-correction margin — the code may still look fine and still fail to scan.
Is the PNG suitable for print?
At small sizes the modules blur. Export larger, or generate a vector code in a design tool for anything going to press.