Guide
QR codes from a URL, on a host that still answers
The QR half of the old Google Charts API went away with the rest of it: chart.googleapis.com/chart answers HTTP 404 for cht=qr, re-checked on 2026-11-28. Every shelf label, facility sign and internal dashboard still pointing there now renders a broken image. The fix is smaller than a library migration — chl, chs, chld and choe keep their meanings here, so a QR URL changes one segment: the host.
Why a 404 is the worst way for a QR code to fail
The endpoint answers with an HTML 404, not a PNG with an error drawn on it. A browser shows a broken-image icon and the alt text; a PDF generator places nothing, or the alt text where the code should be; a batch job that printed five hundred shelf labels last month has already shipped the wrong thing. Nothing in the URL announces the change: the same string worked for years, and the failure appears as a hole in someone else's document.
It is not a historical problem either. Projects were still opening issues in November 2026 about QR images that had quietly stopped appearing, with the cause sitting in an endpoint that has been off since 2019 — deprecated in April 2012, with the turn-off announced for 14 March 2019. The URL outlived the service inside code because nothing validated the host, and a QR code is the one image nobody looks at after it goes live.
One host, and nothing else changes
The two URLs below differ in the host segment only. The payload (% for %), the canvas, the error-correction level and the quiet zone are the same request:
https://chart.googleapis.com/chart?cht=qr&chs=360x360&chl=https%3A%2F%2Furlchart.com%2Fi%2F8f3a2c1d&chld=H|4&choe=UTF-8
https://urlchart.com/chart?cht=qr&chs=360x360&chl=https%3A%2F%2Furlchart.com%2Fi%2F8f3a2c1d&chld=H|4&choe=UTF-8
That URL is the whole chart — an <img src>, a print template, or the job that fills your label roll:
<img src="https://urlchart.com/chart?cht=qr&chs=360x360&chl=https%3A%2F%2Furlchart.com%2Fi%2F8f3a2c1d&chld=H|4&choe=UTF-8"
width="360" height="360" alt="QR code for item 8f3a2c1d">
The parameters a QR URL actually reads
A QR chart does not plot data, so chd, axes and legends are not used. Five parameters describe the code itself (margins, a background fill and the output format change the image around it):
| Parameter | Value | What it does |
|---|---|---|
cht | qr | selects the QR renderer. Any other chart type ignores chl as a payload. |
chl | your text or URL, percent-encoded | the payload. %20 is a space and a literal + decodes to a space too, so percent-encode rather than substituting +. Underscores stay underscores here, unlike category labels. A byte-mode code holds at most 2,953 bytes. |
chs | widthxheight in pixels | the canvas. The code is always square and centred; a non-square size still renders and is reported as degraded. |
chld | <L|M|Q|H>|<margin> | error-correction level and the quiet zone in modules. Default L|4; the margin is capped at 16 modules. If the payload cannot fit the level you ask for, it is re-encoded at L and the change is reported instead of truncating a byte. |
choe | UTF-8 (default), Shift_JIS, ISO-8859-1 | output encoding. The payload bytes are always written as UTF-8, so UTF-8 is exact; requests naming Shift_JIS or ISO-8859-1 are accepted, but the code is still encoded as UTF-8 and the substitution is reported as a degraded note in X-UrlChart-Meta — they never produce a code that decodes to different text. |
Printed labels and stock shelves
A shelf label has the harshest reading conditions of anything on this list: fluorescent light, a plastic sleeve, a phone held at an angle by someone in a hurry. Two parameters matter most.
- Raise the error-correction level.
chld=H|4uses levelH, which can recover about 30% of the codewords — that redundancy is what keeps a scuffed label readable. At levelLthe same scuff can make the code undecodable. - Keep the quiet zone. The 4-module white border is part of the specification, not padding. Design tools routinely crop it, and the code then fails on the device where it mattered.
chld=H|4keeps it; a larger number widens it. - Render at the module size you print. A label printed 40 mm wide from a 360 px render gives each module about 1 mm — comfortable. Blowing up a small render is not the same thing: 120 px across 120 mm blurs module edges into the background, which is where scanners start failing.
- One URL per SKU. A per-item payload (
https://example.com/i/<sku>) is a new URL and a new render, cached afterwards — printing the same label twice is a cache hit.
Documents and PDFs
Invoices, delivery notes and tickets are written by a report generator with no browser, and a QR code is the one figure in them that must be machine-readable rather than legible. The URL does that without a QR library: one HTTPS GET, the PNG placed at the size you choose, no encoder in the build.
- Do not scale the PNG up in the PDF — that multiplies pixels, not modules. Render at the target size instead.
- Keep the payload short. A 31-byte URL renders as a 33-module symbol at level
H(25 atL) and stays readable at small sizes; a 200-byte tracking URL needs a denser symbol and a bigger print box. - The PNG is cached immutable, so regenerating the same document next month costs a request and no render.
chof=pdfreturns a one-page PDF instead if your pipeline prefers it.
Smart-home panels and kiosks
A wall panel or a Raspberry Pi dashboard is where a chart library is pure overhead: no build toolchain, no reliable package updates, often a 240–480 px screen. A URL is an <img> tag in a template that never changes.
- A fixed square canvas (
chs=240x240) matches the tile the panel reserves, so the layout does not jump while the image loads. - The payload is usually a local address or a Wi-Fi join string; percent-encode it and keep the level at
MorHif the panel's screen is glossy. Put only a join string you are willing to publish in the URL — a chart URL is cached and forwarded like any other URL. - Repeat requests for the same URL are cache hits, so a panel that redraws every minute is neither a load problem nor a metered one.
Free tier: no key, no watermark
Anonymous requests work: no account, no API key, no watermark on the image, and the bytes are identical to a paid render at the same canvas size. What the free tier does have is a limit and a canvas cap.
- 1,000 unique renders per month, counted per IP address hash. A unique render is a request that missed the edge cache and produced an image; the same URL served again is a cache hit and never counted, so a QR code printed on 50,000 labels is one render. When the figure is reached, further requests are limited until the next calendar month (UTC).
- 60 requests per minute per IP, and a canvas of at most 1000 px per side and 1,000,000 px total. A larger
chsis not an error — the image is scaled down and the served size is reported inX-UrlChart-Meta. - Paid is $29/month or $290/year: 3000 px per side, 9 MP, 120 requests per minute and a 100,000 unique-render soft ceiling with a 10,000/day trigger. Crossing a line throttles the key and starts a conversation; it never cuts production traffic off mid-month. Details on pricing.
Questions that come with this migration
Do I have to change chld or choe when I move the host?
No. chld and choe are read exactly as before, including the | separator and the same level letters. If you never set them, the defaults are level L and a 4-module margin — the same quiet zone the old endpoint drew.
My QR image is a broken icon and there is no error message. Why?
Because the request is answered with an HTML 404, which an <img> tag cannot display. Fetch the URL directly — curl -I is enough — and you will see the status. If the host is still chart.googleapis.com, the host is the problem, not the parameters.
What if my payload is too long for a QR code?
A byte-mode code holds at most 2,953 bytes. A payload that does not fit the level you asked for is re-encoded at L and the downgrade is reported in X-UrlChart-Meta. If even L cannot hold it, the image is a text card explaining the limit — the payload is never truncated.