WiFi QR Code Generator

A WiFi QR code holds a network name, a security type and a password in one scannable string. Point a phone camera at it and the phone offers to join the network, so nobody has to read the password off a whiteboard. Image-Charts renders one from a single URL that carries cht=qr and the credentials in chl.

How Do You Generate a WiFi QR Code?

Put the network details in a WIFI: payload, URL-encode it, and pass it as the chl parameter of a cht=qr chart. The response is a PNG you can use anywhere an image goes.

The payload you encode

WIFI:T:WPA;S:Demo;P:hunter2;;

The URL you request

https://image-charts.com/chart?cht=qr&chs=300x300&chl=WIFI%3AT%3AWPA%3BS%3ADemo%3BP%3Ahunter2%3B%3B

QR code encoding the WiFi network named Demo with WPA security
The image above is that URL, rendered by this page as a plain image tag. Scanning it returns the payload verbatim. Unsigned charts are free, rate limited, and carry the small watermark you can see in the corner. Paid plans remove it.

The WIFI: Payload Format

The payload format comes from ZXing, the barcode library the first Android scanners shipped with, and it is what the iOS Camera app and the Android scanner read when they offer to join a network. Fields are separated by semicolons, and the payload closes with two of them.

Fields of the WiFi payload and what each one carries
FieldMeaningNotes
T:Security typeWPA covers WPA, WPA2 and WPA3. WEP for an old network, nopass for an open one.
S:Network name (SSID)Exactly as it is broadcast. Case sensitive.
P:PasswordLeave it out when the type is nopass.
H:Hidden networkH:true when the SSID is not broadcast. Omit it otherwise.
;;End of the payloadTwo semicolons close the string.

Escaping and Encoding

Two passes, in this order. Inside S: and P:, a backslash escapes the five characters that would otherwise end a field (backslash, semicolon, comma, colon, double quote), so a password of p;ss is written p\;ss. Then URL-encode the whole payload once, because those same semicolons and colons carry meaning in a query string. WIFI:T:WPA;S:Demo;P:hunter2;; becomes WIFI%3AT%3AWPA%3BS%3ADemo%3BP%3Ahunter2%3B%3B.

An open guest network needs no password field. Its payload is WIFI:T:nopass;S:Guest;; and it renders the same way.

Parameters

cht, chs and chl are required. The rest decide how the code is drawn.

Image-Charts parameters that control a QR code
ParameterWhat It ControlsValues
cht=qrChart typeRequired.
chsSize in pixels, width x heightRequired. A QR code is square, so the width decides. Below 29 pixels wide the API returns a blank square instead of an unreadable code.
chlThe data to encodeRequired, UTF-8 URL-encoded. A URL tops out near 2K, so a longer payload goes through a POST request.
chldError correction level and marginL is the default, then M, Q and H, recovering 7%, 15%, 25% and 30% of a damaged code. The margin is a border width counted in rows, 4 by default, and unsigned charts widen it so the watermark stays legible.
icqrfForeground color, RRGGBB or RRGGBBAADefault 000000.
icqrbBackground colorDefault FFFFFF. An alpha channel of 00 makes it transparent.
chofOutput format.png by default, .svg for vector output.
choeData encodingUTF-8, the only supported value.

A higher error correction level survives a scuffed sticker or a code someone dropped a logo onto, at the cost of holding less data in the same square. A WiFi payload is short, so H costs you nothing here.

Putting the Code on a Wall

  1. Write the payload for the network, with its type, SSID and password.
  2. URL-encode it and append it to https://image-charts.com/chart?cht=qr&chs=300x300&chl=
  3. Open the URL and scan the result with a phone. If it offers to join the network, the payload is right.
  4. Use the URL in an img tag, an email template or a signage tool, or save the PNG and print it.

The password sits in the URL, so it travels wherever that URL travels, into browser history, server logs, a CDN cache and the analytics of the page that embeds it. Our privacy policy covers what happens on our side. For a café guest network this is the whole point. For a network you care about, render the code once, keep the image and drop the URL, or run the API inside your own network with Image-Charts On-Premise.

If the codes come out of a scheduled job or a no-code tool rather than your own code, the integrations and the agent tooling reach the same API without a rewrite.

Generate Your WiFi QR Code

Open the Chart Editor