QR codes

QR is the code most documents end up wanting: a payment to make on an invoice, a boarding pass, a link to a case file, a serial number on a label. It is also the one most often fetched from some website, downloaded as a picture and pasted in — which works until the day the picture is resized and the code stops reading.

Choose QR when the thing reading the page is a telephone. It is the one code an ordinary person will point a camera at without being shown how, and that is worth more than any technical advantage: a customer pays an invoice, opens a case file or checks a serial number without typing a character. It carries a few thousand characters, which is a whole bank transfer or a whole address rather than a reference to one. Three codes stand on the page below, each captioned with the text it carries and each keeping the band of white the standard asks for around it. That band is the first thing a tight layout eats into, and it is what lets a scanner find the code at all.

What this example shows

  • QR codes drawn line by line, sharp at any size.
  • The white margin the standard requires, kept around each code.
  • Every code captioned with the text it carries.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

Examples near this one

Code 128 and retail barcodes

Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.

Data Matrix codes

The code industry marks small parts with: still readable at sizes where a QR code has given up, on a circuit board or a phial in a laboratory tray.

PDF417 codes

The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.

Aztec codes

The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.

A picture fitted into a rectangle

One picture fitted into a rectangle of one size eight ways: three ways of sizing it, the same one stood in the top left corner with a 12-point inset, a quarter turn left, a quarter turn right, a turn of 20 degrees, and a left-to-right mirror — every panel drawing the picture at the place and the size the library worked out.

Every example, by subject