Developers

A drop-in replacement for the Google Charts QR code API

To replace the Google Charts QR code API, change https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=DATA to https://qrcodesforever.com/qr.png?text=DATA. The chl value becomes text, and cht and chs can be dropped. The new URL needs no key and returns a PNG, or an SVG from /qr.svg, that never changes for the same URL.

On 1 December 2026, a request to https://chart.googleapis.com/chart?cht=qr&chs=150x150&chl=Hello%20world returned HTTP 404 with an HTML error page. If an old spreadsheet or template shows empty boxes where QR codes used to be, that's why.

Google deprecated its Image Charts API, QR codes included, in 2012. In February 2019 the maintainer announced on the Google Chart API group that it would be turned off on 14 March 2019, and said of QR codes in particular that Google had no suggested replacement.

Before and after

Before: https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=Hello%20world
After:  https://qrcodesforever.com/qr.png?text=Hello%20world

The new URL returns a 512-pixel PNG whose code contains Hello world, a version 1 code (21×21 modules). For an <img> tag, keep your old width and height and change only src. For a vector image, use /qr.svg.

Parameter mapping

Google ChartsQR Codes ForeverNotes
https://chart.googleapis.com/charthttps://qrcodesforever.com/qr.pngOr /qr.svg for a vector image.
cht=qrdrop itOur endpoints only make QR codes.
chl=<data>text=<data>Same value, already URL-encoded. Up to 2,000 characters.
chs=300x300size=512 (PNG only)Square PNGs at 512, 1024, 2048 or 4096 px. Set the shown size with width and height.
choe=UTF-8drop itText is always UTF-8. Shift_JIS and ISO-8859-1 aren't offered.
chld=L|4not adjustable yetFixed at error correction M and a 2-module margin.
(no equivalent)fg, bg, pattern, cornersColors and module shapes.

text= copies Google's behavior: the value goes into the code exactly as sent. For links, url= is stricter. It adds https:// when the scheme is missing and rejects anything without a real domain, which catches typos before they reach print. UTF-8 means accented letters, Hindi, Chinese and Arabic all encode as they did with choe=UTF-8.

If your print layout depended on a 4-module margin from chld, add white space around the image. Our 2-module margin is enough for screens; the quiet zone guide covers print.

Spreadsheets

Most surviving uses of the old API are spreadsheet formulas:

Before: =IMAGE("https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=" & A2)
After:  =IMAGE("https://qrcodesforever.com/qr.png?text=" & ENCODEURL(A2))

The ENCODEURL fixes a bug many of those sheets had all along: a link with & in it was cut short at the &, and the code pointed somewhere slightly wrong. Find and replace, with "Also search within formulas" ticked, updates a whole sheet in one pass. Excel on Mac and the web has no ENCODEURL; the Excel page has the replacement. The Google Sheets page covers multi-column codes and saving files.

HTML and server templates

<img src="https://qrcodesforever.com/qr.png?text=Hello%20world"
     alt="QR code" width="300" height="300">

In server code it's usually one line in whatever function built the Google URL. More patterns are in QR codes in HTML.

What changes for the better

Google's API took a finished string in chl, so anyone making a Wi-Fi or contact code had to build WIFI: or BEGIN:VCARD text by hand and escape it correctly. Ours takes the fields. ?ssid=Cafe%20Guest&password=coffee123 produces WIFI:T:WPA;S:Cafe Guest;P:coffee123;;, with special characters escaped for you. The parameter reference covers WhatsApp, events, locations, UPI, Pix, SEPA (EPC) and crypto the same way.

The fair worry is that this API goes the same way. The codes are static and every URL always returns the same image, so a CDN serves almost all requests from cache. That is what keeps the endpoints free without a key. A paid REST API for logos and batch jobs is planned, and it won't replace these URLs. If you can't accept any outside dependency, download the images once and host them yourself; a static QR code works the same from any server.

Facts checked on

Written by Last updated