Free QR code API

Our QR code API is a plain image URL. Put your content in the query string, like https://qrcodesforever.com/qr.png?url=example.com, and the response is a finished PNG or SVG QR code. Anyone can call it without an API key or account, and the same URL returns the same image every time.

01Details

02Theme

03Logo

Optional

How to do it

  1. 1

    Pick a format

    Use /qr.svg for web pages and print, or /qr.png for spreadsheets, email and anything that can't show SVG.

  2. 2

    Add your content

    Add it as a query parameter, like ?url=example.com or ?type=wifi&ssid=Cafe. Percent-encode the value if it contains &, #, + or spaces.

  3. 3

    Use the URL as an image

    Paste it into an <img> tag, a Markdown image, a spreadsheet IMAGE() formula, or download it with curl.

One request, start to finish

curl -o menu.png "https://qrcodesforever.com/qr.png?url=example.com&size=1024"

That's the whole API: a GET with the content in the query string. The response is a 1024-pixel PNG of a QR code that opens https://example.com. We add the https:// when you leave it off. Swap /qr.png for /qr.svg to get a vector file instead.

The live SVG endpoint returned these headers on 1 December 2026:

content-type: image/svg+xml; charset=utf-8
cache-control: public, max-age=31536000, immutable
access-control-allow-origin: *
x-content-type-options: nosniff
content-security-policy: default-src 'none'; style-src 'unsafe-inline'

The cache header is a year because the image for a given URL never changes. The open CORS header means fetch() works from any website.

What each URL puts in the code

A QR code is only as good as the text inside it, so here is exactly what our encoder writes for a few common requests. Every row was generated with the same code that serves the API and decoded again to check it.

RequestText inside the codeQR version
?url=example.comhttps://example.com2 (25×25)
?text=Table%2012Table 121 (21×21)
?ssid=Cafe%20Guest&password=coffee123WIFI:T:WPA;S:Cafe Guest;P:coffee123;;3 (29×29)
?type=whatsapp&whatsapp=919876543210&message=Hihttps://wa.me/919876543210?text=Hi3 (29×29)
?q=Eiffel%20Towerhttps://www.google.com/maps/search/?api=1&query=Eiffel%20Tower4 (33×33)
?upi=shop@okaxis&amount=250upi://pay?pa=shop@okaxis&am=250.00&cu=INR3 (29×29)

The parameter reference covers all 14 kinds, including contact cards, calendar events, Pix, SEPA transfers and crypto. Fewer characters means a lower version with bigger squares, which scans from further away; the versions and capacity guide explains the trade.

Encode the value, or the code will lie

The value sits inside a URL, so &, #, + and spaces have to be percent-encoded. Skip it and the API reads something you didn't mean:

You sendThe code contains
?url=https://shop.com/?a=1&b=2https://shop.com/?a=1 (the b=2 became a separate parameter)
?url=https%3A%2F%2Fshop.com%2F%3Fa%3D1%26b%3D2https://shop.com/?a=1&b=2
?phone=+441234567890tel:441234567890 (the + turned into a space)
?phone=%2B441234567890tel:+441234567890

Both broken versions still return a valid image. Nothing errors, and the code quietly opens the wrong thing. Use your language's encoder: encodeURIComponent in JavaScript, urllib.parse.urlencode in Python, ENCODEURL in spreadsheets.

Style

fg and bg take six-digit hex colors without the #. pattern is square, rounded or dots, and corners is square, rounded or circle:

/qr.svg?url=example.com&fg=1d3fd6&bg=ffffff&pattern=dots&corners=circle

Light modules on a dark background fail on some phone scanners, so run unusual pairs through the contrast checker first.

When it says no

Missing or invalid content gets a 400 with this exact plain-text body:

Missing or invalid content. Try ?url=example.com, ?upi=name@bank or ?type=wifi&ssid=MyWifi

Content too large for one QR code gets a 413 and Too much data for one QR code. A thousand Chinese characters is enough to trigger it, because each one takes three bytes.

Who should use something else

The content travels to our server in the URL. For anything private, such as a Wi-Fi password you'd rather not send over the network, make the code in the generator instead, where it never leaves your browser, or use an offline library. If you need a logo, use the generator too, because a URL can't carry an image. And if you need to change where a printed code points, or count scans, you need a dynamic code, which we don't sell yet.

A paid REST API for logos and batch jobs is planned. It doesn't exist yet, and the image URLs on this page will stay free when it arrives. Until then, the bulk generator makes hundreds of codes from a CSV in your browser.

Questions people ask

Is there a rate limit?

None is published. Every image is sent with a one-year cache header, so browsers and our CDN reuse it instead of drawing it again. If you make thousands of codes, save the files on your side and run requests one after another.

What happens to my embedded codes if this site goes down?

Images that load from our URL would stop loading until it's back. Codes already printed or saved keep scanning, because everything the phone needs is inside the code. For a page that must never show a broken image, download the file once and host it yourself.

Do I have to credit QR Codes Forever?

No. A link back is how other people find the API, so it's welcome, but the images work the same without one. The terms cover commercial use.

Last updated