Free QR code API

One URL in, one QR code image out. PNG or SVG, any size and color, no API key, no sign-up, no watermark. CORS is open and every image is cached at Cloudflare's edge.

GET https://qrcode.pub/api/qr?data=<text or link>&size=300&format=png

Example: https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=300

Try it

QR code made by the API

Parameters

NameDefaultDescription
datarequiredThe text or link to encode, URL-encoded. Up to 2000 characters (UTF-8, emoji are fine). text also works.
size300Image width/height in pixels, 32 to 2000. 300 or 300x300.
formatpngpng or svg.
color000000Foreground color: hex (1a237e, %231a237e) or r-g-b (26-35-126).
bgcolorffffffBackground color, same formats. bg also works.
eccMError correction: L 7%, M 15%, Q 25%, H 30%. Use H if you put a logo on top.
margin4Quiet zone around the code in modules, 0 to 20. Scanners need at least 2 to 4.

Errors return HTTP 400 with JSON like {"error": "..."}. Responses send Access-Control-Allow-Origin: * and Cache-Control: public, max-age=31536000, immutable.

Examples

HTML

<img src="https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=200" alt="QR code" width="200" height="200">

Markdown (GitHub README, docs)

![QR code](https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=200)

curl

curl -o qr.svg "https://qrcode.pub/api/qr?data=hello%20world&format=svg&color=1a237e"

JavaScript

const src = 'https://qrcode.pub/api/qr?' + new URLSearchParams({ data: 'https://example.com', size: 400, ecc: 'H' });
document.querySelector('img').src = src;

Google Sheets / Excel

=IMAGE("https://qrcode.pub/api/qr?size=200&data=" & ENCODEURL(A2))

Printing these codes on packaging, menus or signs? A static code can never be changed. A dynamic QRCode.Pub code points to a short link you can redirect any time, with scan counts: $9 once, no subscription, never expires.

Make an editable QR code →

FAQ

Do I need an API key?

No. There is no key, account or sign-up. Call the URL from a browser, an <img> tag, a server or a spreadsheet.

Is it really free? Are there limits?

Yes, it is free. There is no hard quota; please cache images you reuse and keep traffic reasonable. Responses are cached for a year, so the same URL is served from the edge.

Do you store the data I encode?

No. The image is generated on the fly and the content is not saved. We only count the number of calls per day and the referring website, with no IP addresses.

Can I use the codes commercially?

Yes. The images are yours to print or ship in your product, with no watermark and no attribution required.

Do the QR codes expire?

No. They are static codes: the content is inside the image, so they work forever. The catch is that you can never change what they point to after printing.

Can I change where a printed code points?

Not with a static code. For that, create a dynamic QRCode.Pub code: it points to a short link you can edit any time, with scan counts, for $9 once (no subscription).

No code? Use a generator

Bulk QR code generator · Free QR code generator with no expiration · WiFi QR code generator · vCard QR code generator · Restaurant menu QR code · Google review QR code · WhatsApp QR code generator · Instagram QR code generator · PDF QR code generator · Email QR code generator · SMS (text message) QR code generator · Phone call QR code generator · YouTube QR code generator · Facebook QR code generator · TikTok QR code generator · LinkedIn QR code generator · Google Maps location QR code · Calendar event QR code generator · Text QR code generator · Real estate sign QR code · Google Form QR code generator · App download QR code · Why did my QR code stop working? · Dynamic QR code without a subscription · Can you change a QR code after printing it? · Static vs dynamic QR codes · Printable WiFi QR code sign · QR code table tent maker