Every barcode is a sequence of named parts, and each part has a job. Hover any region of the diagrams below and it will tell you what that region is, how many modules it occupies and what would break if it were missing — for EAN-13, Code 128, Code 39, ITF-14 and QR Code. Then type any value and watch it become a module sequence, live, in your browser.
Hover, tap or tab through the regions. Selecting a region pins it so the panel below keeps showing it while you look at the rest of the symbol.
| Region | Role | Modules | What it does |
|---|
| Block | Kind | Codewords | Starts at |
|---|
| Symbology | Kind | Fixed structure | Payload | Error detection |
|---|---|---|---|---|
| EAN-13 | 1D | 101 start guard + 6 digits + 01010 centre guard + 6 digits + 101 end guard = 95 modules, plus 11 and 7 modules of quiet zone | 12 digits; the 13th is computed, and its value is carried by the parity of the left half, not by any bar of its own | Modulo-10 check digit (weights 3, 1, 3, 1 …), verified by the decoder |
| Code 128 | 1D | Start character + data + check symbol + stop character; every symbol character is 11 modules, the stop is 13 | Any ASCII text, in one of three code sets; digits packed two to a character in set C | Modulo-103 check symbol — a full 11-module character, not one digit |
| Code 39 | 1D | * start + characters separated by a narrow gap + * stop;
each character is 9 elements, 3 of them wide |
43 characters: 0-9, A-Z, space and - . $ / + % |
Optional modulo-43 check character. Most Code 39 symbols carry no check at all |
| ITF-14 | 1D | 1010 start + digit pairs + 11101 stop, printed inside a bearer bar | Digits only, in pairs — one digit in the bars, the next in the spaces between them | GTIN-14 check digit, and a self-checking element structure |
| QR Code | 2D | 3 finder patterns + separators + timing patterns + alignment patterns + format information, with data and error-correction codewords filling the rest | Any text; numeric, alphanumeric or byte mode, chosen automatically | Reed-Solomon error correction at one of four levels |
A linear barcode is not read as an image. A scanner sweeps one or more lines across the symbol, turns each line into a sequence of black and white runs, and measures their widths. From that run-length sequence it works out the module width, then converts each group of elements into a character using the symbology's table — which is why the tables on this page are worth looking at: they are the decode step.
A 2D symbol is read as a grid instead. The finder patterns give the detector three corners, from which it can work out the symbol's scale, rotation and perspective; the timing patterns count the modules between them; and the format information tells the decoder which error-correction level and which of the eight masks was used, so it can unmask the grid before reading a single codeword.
This page is an explainer, not a certified encoder. It implements the parts of EAN-13, Code 128, Code 39, ITF-14 and QR Code that make their structure visible and checkable: the module patterns, the character tables, the check-value arithmetic and the QR placement rules. It does not implement UPC/EAN extensions and add-ons, the Code 128 FNC1-4 function characters for GS1 application identifiers, Code 39 full-ASCII escapes, or the full ISO/IEC 18004 mode set beyond numeric, alphanumeric and byte.
Where a symbol's numbers come from. Every count on this page is derived from the
encoded module sequence rather than typed in, so if the encoder and the description ever
disagreed, the description would change — not the picture. The character tables themselves are the
published symbology tables, written out in full in barcode-1d.js so they can be
checked against the standard line by line.
Why the wide-to-narrow ratio is a choice. Code 39 permits a ratio between 2:1 and 3:1 and GS1 permits 2.25:1 to 3.0:1 for ITF, so two conformant symbols of the same value can have different widths. This page draws Code 39 and ITF at 3:1 because a module grid can only draw whole modules. That is why a Code 39 symbol here may be a little wider than one printed by another tool: both are correct, and the ratio is a print decision.
What a barcode is not. A barcode is not a secret and not a signature. Anyone with a phone can read every value on this page, and the check digit is an error-detection mechanism, not a security one — it catches misreads, not forgery. Keep test payloads synthetic.
To read real symbols — from a camera, an image, a PDF or a multi-page TIFF — use the online barcode scanner, which decodes 1D and 2D formats and reports the value, the symbology, the bounding box and the decode time. To produce symbols of your own, use the barcode and QR code generator.