Published Nov 24, 2026· Updated Nov 25, 2026
# What Is a Barcode?
A barcode is a printed pattern of parallel bars and spaces whose widths encode data, so an optical reader can capture it in milliseconds without a keyboard. Every one-dimensional barcode carries a number: UPC-A carries 12 digits, EAN-13 carries 13, ITF-14 carries 14. GS1, the standards body behind retail numbering, puts the volume at over 1 billion products identified by GS1 barcodes and roughly 10 billion scans every day. The full family of formats is compared on the barcode symbologies page; this article covers what the symbol is made of, why the number under it is not arbitrary, and which print rules decide whether it scans.
Anatomy of a barcode
A linear symbol is not a random stripe pattern. Each element has a defined job, and a reader fails when any one of them is compromised.
| Element | What it is | Why a reader needs it |
|---|---|---|
| Quiet zone | Blank margin at each end of the bars | Marks where the symbol starts and ends, so artwork never reads as data |
| Guard bars | Extended bars at the left, centre and right | Fix the digit boundaries and let the code be scanned in either direction |
| Data bars | The bars and spaces between the guards | Carry the encoded digits as width ratios |
| X-dimension | Width of the narrowest element | Sets the whole symbol size; every other width is a multiple of it |
| Human-readable number | Digits printed under the symbol | Lets a cashier key the code in when the symbol will not scan |
| Check digit | The final digit, computed from the others | Detects most keying and misreads before the price lookup happens |
Because the data lives in width ratios rather than absolute sizes, the same symbol can be printed at many different scales. The limit is the X-dimension: shrink the narrow bar too far and the reader can no longer separate a 2-wide element from a 3-wide one. That is why GS1 General Specifications fixes a minimum, a target and a maximum X-dimension for each symbology rather than a single size.
How a scanner reads it
A scanner lights the symbol and measures reflected intensity. Bars absorb light, spaces return it, so the reflected signal is a sequence of transitions whose timing encodes element widths. The decoder finds the quiet zone, locks onto the guard bars, groups elements into characters and validates the check digit before returning a number.
Two practical consequences follow. First, a barcode is read by reflectance, not by shape, so contrast matters more than resolution: a symbol printed in a pale colour, or printed with too little ink spread, can carry the right geometry and still fail. Second, barcode readers are symbology-specific: a reader must know the format to group widths correctly, which is why the symbology choice on a label is not cosmetic. Retail POS readers are built around the EAN/UPC family, and the symbology itself is standardised as ISO/IEC 15420.
The symbology family
Nine formats cover almost everything printed on products, cases and logistics labels. Each has its own character set, length rule and standard.
| Symbology | Data carried | Standard | Where it is used |
|---|---|---|---|
| EAN-13 | 13 digits | ISO/IEC 15420 | Retail point of sale outside North America, GTIN-13 |
| UPC-A | 12 digits | ISO/IEC 15420 | Retail point of sale in the US and Canada, GTIN-12 |
| EAN-8 | 8 digits | ISO/IEC 15420 | Small packages where a 13-digit symbol will not fit |
| ITF-14 | 14 digits | ISO/IEC 16390 | Corrugated shipping cases, GTIN-14 with bearer bars |
| Code 128 | All 128 ASCII values, variable length | ISO/IEC 15417 | Warehouse, shipping and internal asset labels |
| GS1-128 | Code 128 plus Application Identifiers | GS1 General Specifications | Batch, expiry, serial numbers on logistics labels |
| Code 39 | 43 characters | ISO/IEC 16388 | Automotive and legacy military asset tracking |
| Data Matrix | Text and binary in a square grid | ISO/IEC 16022 | Small items, electronics, healthcare marking |
| QR code | Text and binary in a square grid | ISO/IEC 18004 | Consumer links, payments, menus |
EAN-13, UPC-A, EAN-8 and ITF-14 all belong to the same EAN/UPC family, so a POS reader that handles one handles the others. Code 128 and GS1-128 trade a fixed digit count for variable-length text, which is why logistics labels moved to them; the Code 128 guide covers the three code sets and the mod-103 check. Case-level numbering is covered on the ITF-14 guide.
Print rules that decide whether a code scans
These values come straight from the GS1 symbol specification tables. Height is measured across the bars only, excluding the human-readable digits, and quiet zones are expressed as multiples of the X-dimension.
| Symbology | X-dimension min / target / max (mm) | Minimum symbol height (mm) | Quiet zone left / right |
|---|---|---|---|
| EAN-8 | 0.264 / 0.330 / 0.660 | 14.58 / 18.23 / 36.46 | 7X / 7X |
| EAN-13 | 0.264 / 0.330 / 0.660 | 18.28 / 22.85 / 45.70 | 11X / 7X |
| UPC-A | 0.264 / 0.330 / 0.660 | 18.28 / 22.85 / 45.70 | 9X / 9X |
| ITF-14 | 0.495 / 0.495 / 1.016 | 31.75 | 10X / 10X |
EAN/UPC symbols keep a fixed height-to-width relationship, so scaling one dimension without the other breaks the symbol: GS1 US guidance states plainly that truncating the height is not recommended because it stops the symbol scanning at the point of sale. If a layout is tight, regenerate at the correct ratio in the barcode generator instead of stretching a downloaded image, then place the result on the label sheet with the quiet zone preserved.
Why the number is not arbitrary
The digits under an EAN-13 form a GTIN-13, and the last digit is derived from the other 12. Take the odd positions times 1 and the even positions times 3, add them, and the check digit is (10 minus that sum modulo 10) modulo 10. For the data digits 400638133396 the weighted sum is 98, so the check digit is 2 and the finished code is 4006381333962.
We tested what that actually protects against rather than repeating the usual claim, enumerating every single-digit error and every transposition:
| Error type | Detected | Undetected |
|---|---|---|
| One digit keyed wrong | 117 of 117 cases | 0 |
| Two neighbouring digits swapped | 880 of 990 cases | 110 |
| Two digits swapped with one digit between them | 0 of 2,700 cases | 2,700 |
The full enumeration, including the cross-format rule that works for every GTIN length, is on the EAN-13 check digit page, along with the EAN-13 versus UPC comparison of the two retail key lengths.
Do barcode prefixes show where a product was made?
No, and this is the single most repeated misunderstanding about barcodes. The leading digits identify the GS1 member organisation that issued a company prefix, not the factory. GS1's own reference page states that because member companies can manufacture anywhere in the world, GS1 prefixes do not identify the country of origin for a given product. GS1 US said the same publicly in 2020 after viral posts claimed the first three digits reveal manufacturing location. Codes beginning 690 to 699 were allocated to GS1 China, 400 to 440 to GS1 Germany, 500 to 509 to GS1 UK: that tells you where the company licensed its prefix, which often but not always matches its headquarters. The full allocation table is on the GS1 company prefix page.
Barcode or QR code
Use a one-dimensional barcode when the payload is a registered product number that a POS system must recognise, and a two-dimensional code when the payload is a link, a text string or a few hundred bytes of data. A linear symbol needs a symbology-specific reader and stores at most a couple of dozen characters; a QR code stores up to 2,953 bytes and any phone camera can read it. Retail is converging on two-dimensional codes at the checkout, but the EAN/UPC number underneath stays the item's identity either way. For the dimension-by-dimension comparison see QR code vs barcode and for the other 2D family member QR code vs Data Matrix.
A short history
- 1948: the US chain Food Fair asked Drexel Institute of Technology to research automatic product identification at the checkout.
- 20 October 1949: Bernard Silver and Norman Joseph Woodland filed the patent later described as "Classifying Apparatus and Method", covering both a linear pattern and a concentric bullseye. It was granted on 7 October 1952 as US patent 2,612,994.
- 1970: a McKinsey-led grocery Ad Hoc Committee asked for a machine-readable product code. IBM engineer George Laurer rejected the bullseye because a circular pattern smears on a high-speed press, and designed the linear symbol; see IBM's account.
- 1 April 1973: the Universal Product Code was adopted, and the Uniform Code Council became its administrator.
- 26 June 1974: the first retail scan, a 10-pack of Wrigley's Juicy Fruit costing 67 cents, at a Marsh supermarket in Troy, Ohio, on an NCR checkout with a Spectra Physics laser scanner. The scanner is held in the Smithsonian's collection.
- 1977: the European Article Numbering Association was founded in Brussels, making EAN compatible with UPC.
- February 2005: EAN and UCC merged into GS1, which today coordinates 116 member organisations.