QR and Data Matrix Settings Side by Side

A square code is not one thing. A code printed on a crate that gets scratched needs more of itself kept in reserve than a code on a screen; a code that must fit a narrow label has to be a strip rather than a square; a code that the printing works has laid out in advance has to come out at exactly the size the layout left for it. Getting one of these wrong shows up at the far end, when the code does not scan.

This page lays the choices out side by side. The same text is written at the four correction levels, from the one that keeps the least in reserve to the one that survives the most damage, and the code grows denser as the level rises. Three QR codes hold three kinds of text — digits only, capitals and punctuation, and any byte at all — and the Data Matrix codes come as strips and at a size named in advance.

What This Example Shows

  • One text at the four correction levels: low, medium, quartile, high.
  • Three QR codes, one for digits, one for capitals and punctuation, one for any byte.
  • Data Matrix codes on an oblong strip, and at a symbol size chosen before the text is known.

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 Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

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.

QR codes

The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.

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.

Codes That Name Their Character Set

Nine codes whose bytes say which character set they are written in, so Greek comes back as Greek and Cyrillic as Cyrillic, whatever set the scanner would have fallen back on.

Every example, by subject