Code 128 and retail barcodes

A page of barcodes, drawn as bars: Code 128 and the retail family, EAN-13, UPC-A, EAN-8.

A page of barcodes drawn line by line rather than as pictures, so they stay sharp at any size and print as finely as the printer can rather than as finely as an image allows. Code 128 for arbitrary text, an EAN-13 for a thirteen-digit article number, a UPC-A for its twelve-digit North American cousin, and a shorter EAN-8.

Whether a barcode works is not a question a page can answer, and not one an eye can: only a scanner can. So each code carries what it says printed under it, and the engine's checks run a code reader over the finished page and compare — which is how the team verified the sample below before publishing it.

What this example shows

  • Code 128 with its subsets chosen for the data given.
  • EAN-13, UPC-A and EAN-8 with their check digits computed.
  • Bars drawn line by line, not a photograph of a barcode.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Code 128 and retail barcodes

What this document weighs

This document weighs 41,762 bytes.

The team has since put a heading and two lines at the top of this page saying what the codes are for, so the earlier figure was taken on a document this one is no longer. See every document measured.

Examples near this one

QR codes

A page of QR codes, drawn as squares.

PDF417 codes

A page of PDF417 codes, drawn as stacked bars.

Every example, by subject