Generate a QR code free and download it as a PNG

A QR code encodes text or a URL as a grid of black and white modules that any phone camera can decode. This page generates one on your device with a local QR library at error-correction level M, draws it onto a canvas with the required quiet zone, and lets you download the result as a PNG — nothing you type is sent anywhere. There is no sign-up, no watermark, and the code never expires because it contains your data directly rather than a redirect link.

Generate QR code — runs on your device

How it works

A QR symbol is a square matrix of modules — the small black and white cells — whose size is fixed by the symbol's version. Version 1 is 21×21 modules; each higher version adds 4 modules per side, up to version 40 at 177×177. The generator first analyzes your input to pick the densest applicable encoding mode: numeric (3.33 bits per digit), alphanumeric (5.5 bits per character, uppercase only), or 8-bit byte mode for ordinary URLs and mixed text. It then selects the smallest version whose data capacity at the chosen error-correction level fits your payload — a typical 40-character URL in byte mode fits comfortably in version 3 (29×29) at level M.

Error correction is what makes QR codes robust in the real world. The data codewords are extended with Reed–Solomon parity codewords, block by block; this tool fixes the level at M, which dedicates roughly 15% of the symbol's capacity to parity and lets a reader recover up to about 15% of damaged, dirty, or obscured modules. (The four standard levels trade capacity for resilience: L ≈7%, M ≈15%, Q ≈25%, H ≈30%.) After interleaving the data and parity codewords, the bits are placed into the matrix in a zig-zag pattern around the fixed structures: the three corner finder patterns readers use to locate and orient the code, the timing lines, and — from version 2 up — the small alignment patterns that correct for perspective distortion. Finally one of eight XOR mask patterns is applied, chosen by penalty scoring, to break up large same-color areas that could confuse a scanner.

The finished matrix is drawn onto an HTML canvas as crisp filled squares — one module mapped to an exact whole number of pixels, so no anti-aliasing blurs the edges — surrounded by the quiet zone, the mandatory white border 4 modules wide on every side. Scanners use the quiet zone to separate the symbol from surrounding print; codes cropped without it are the single most common cause of scan failures. The download button serializes that canvas to a lossless PNG via canvas.toBlob(), which is the right format here: JPEG compression would smear module edges with ringing artifacts, while PNG reproduces them exactly at any size. Because the library runs locally, the text you encode — which might be a Wi-Fi password or a private link — never crosses the network.

Worked example: a QR code for a 42-character URL

Take the URL https://example.com/menu/summer-2026.pdf — 41 characters, encoded in 8-bit byte mode at 8 bits each, plus a 4-bit mode indicator and an 8-bit character count: 340 data bits ≈ 43 codewords needed. Version 2 at level M offers only 28 data codewords, so the generator steps up to version 3 (29×29 modules), which holds 44 data codewords at level M alongside 26 Reed–Solomon parity codewords — meaning up to roughly 13 damaged codewords can be corrected. Rendered at 8 pixels per module with the 4-module quiet zone, the output PNG is (29 + 8) × 8 = 296×296 pixels and about 1.2 KB on disk. Printed at 3 cm wide on a table menu, it scans reliably from 30 cm away — even after a coffee splash covers a corner of the data area, the parity codewords reconstruct the missing modules and the link still opens.

Frequently asked questions

Is this QR code generator really free with no sign-up?

Yes. The code is generated by a JavaScript library running in your own browser, so there is no account, no watermark, and no per-code fee. The downloaded PNG is yours to use commercially or privately.

Does the text or URL I enter get sent to a server?

No. Encoding happens entirely on your device; the page makes no network request with your input. You can disconnect from the internet after loading the page and still generate and download codes.

Do QR codes expire or stop working over time?

A QR code itself never expires; it is just a printed encoding of your text. It only stops working if the thing it points to disappears, such as a URL that goes offline. Paid dynamic QR services expire because they route through a redirect server, which this generator does not use.

How much text can one QR code hold?

At error-correction level M, the largest version 40 symbol holds up to 3,391 characters of 8-bit text or 5,596 numeric digits. Practical codes should stay far smaller, since more data means a denser grid that is harder to scan from a distance.

Will the QR code still scan if it is partly damaged or covered?

Usually, yes. Level M error correction adds Reed-Solomon parity codewords that let a reader reconstruct up to about 15 percent of damaged or obscured modules. Damage to the three large corner finder patterns is the main exception, since readers need those to locate the code.

What size should I print a QR code so phones can scan it?

A rule of thumb is print width of at least one tenth of the intended scanning distance, so 2 cm across for scanning at 20 cm, or 10 cm for a poster read from 1 m. Keep the white quiet zone of 4 module widths around the code, or many readers will fail to lock on.

Related tools