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
QR code encoding the URL https://urlchart.com/i/8f3a2c1d at error-correction level H, 33 modules across, on a 360 by 360 pixel canvas.
Fetched from the second URL as this page loaded — a real render, not a screenshot. Point a camera at it: the payload decodes.

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):

ParameterValueWhat it does
chtqrselects the QR renderer. Any other chart type ignores chl as a payload.
chlyour text or URL, percent-encodedthe 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.
chswidthxheight in pixelsthe 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.
choeUTF-8 (default), Shift_JIS, ISO-8859-1output 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.

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.

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.

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.

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.