Barcode Types Explained: UPC, EAN, Code 128, Code 39, ITF-14, GS1-128, Data Matrix and QR — Which to Use Where
Shops scan EAN-13 and UPC-A; cartons carry ITF-14; pallets GS1-128; stock rooms Code 128; small parts and medicines Data Matrix; phones QR. How each works.
Which barcode type should you use? The short answer
Use the type the people scanning your code expect. Products sold in shops carry EAN-13 (or UPC-A in the US and Canada); books carry an ISBN as an EAN-13; outer cartons carry ITF-14; pallets carry GS1-128 with an SSCC; your own stock, assets and locations can use Code 128; small parts, electronics and medicines use Data Matrix; and anything a customer scans with a phone uses a QR code. The first four are GS1 standards with numbers issued by GS1; the others can hold your own data.
Below, each family is explained with what it holds, how big it must be, which standard defines it and which scanners read it, followed by a table for choosing by situation. Every standard and rule cited was read on 1 October 2026: the GS1 General Specifications (Release 26.0, January 2026), the ISO/IEC symbology standards and scanner makers’ documentation.
Make any of these barcodesEAN, UPC, ISBN, Code 128, GS1-128, ITF-14, Code 39, Codabar and Data Matrix at GS1 sizes, with check digits, a scan check and SVG, PNG or PDF downloads.How a barcode encodes data
A linear (1D) barcode is a row of dark bars and light spaces. A scanner sweeps across it, measures the width of each bar and space, and converts the pattern back into characters. The widths are not arbitrary: every bar and space is a whole number of modules, the narrowest unit, or one of two fixed widths (narrow and wide) in older symbologies. The width of one module is the X-dimension, and it sets the size of the whole symbol.
What a scanner reads, left to right
Every linear barcode has the same parts, in the same order.
Quiet zone
Clear space, typically 7 to 11 modules for EAN/UPC and 10 for Code 128 and ITF, so the scanner knows where the code starts.
Start pattern
A fixed pattern (guard bars in EAN/UPC, a start character in Code 128) that marks the beginning and the reading direction.
Data characters
Each character is a set pattern of bars and spaces: 7 modules per digit in EAN/UPC, 11 per character in Code 128.
Check character
Calculated from the data, so a misread is detected instead of returned as a wrong number.
Stop pattern and quiet zone
Marks the end; the trailing quiet zone must be clear too.
A 2D code such as Data Matrix or QR stores data in a grid of square modules instead. Fixed patterns (the L-shaped border of a Data Matrix, the three corner squares of a QR code) let a camera find the code, work out its orientation and size, and read every module. 2D codes add error correction: extra data from which damaged or missing modules can be rebuilt, which is why they still read when partly scratched. A laser scanner that sweeps a single line cannot read them; a camera-based imager or a phone can.
The human-readable text under a barcode is for people. It is not read by the scanner, and some symbols print it differently from the encoded data: GS1-128 shows its Application Identifiers in brackets, though the brackets are not encoded, and an ISBN barcode prints the hyphenated ISBN above the bars.
The main barcode types at a glance
Swipe sideways to compare columns.
| Type | Family | Holds | Check digit | Typical use | Defined by | Read by |
|---|---|---|---|---|---|---|
| EAN-13 | 1D, GS1 | A GTIN-13: 13 digits | Mandatory, mod 10 | Retail products worldwide | GS1; ISO/IEC 15420 | Every retail scanner and phone app |
| UPC-A | 1D, GS1 | A GTIN-12: 12 digits | Mandatory, mod 10 | Retail products in the US and Canada | GS1; ISO/IEC 15420 | Every retail scanner and phone app |
| EAN-8 and UPC-E | 1D, GS1 | 8-digit GTIN, or a compressed UPC-A | Mandatory | Very small retail packs | GS1; ISO/IEC 15420 | Retail scanners |
| ITF-14 | 1D, GS1 | A GTIN-14: 14 digits | Mandatory | Outer cartons, often printed on corrugated board | GS1; ISO/IEC 16390 | Warehouse scanners |
| GS1-128 | 1D, GS1 | GS1 element strings: up to 48 data characters | Mandatory symbol check, plus GS1 check digits | Pallet and logistics labels (SSCC), batch and dates | GS1; ISO/IEC 15417 | Most 1D scanners |
| Code 128 | 1D | All 128 ASCII characters | Mandatory symbol check | Inventory, assets, shipping, internal labels | ISO/IEC 15417 | Almost every scanner and phone |
| Code 39 | 1D | 43 characters: A–Z, 0–9, space - . $ / + % | Optional, mod 43 | Older inventory, automotive and defence | ISO/IEC 16388 | Almost every scanner |
| Interleaved 2 of 5 | 1D | Digits only, in pairs | Optional | Warehouses, older systems | ISO/IEC 16390 | Most scanners |
| Data Matrix | 2D | Up to 3,116 digits or 1,555 bytes | Built-in error correction | Small parts, electronics, medicines, direct marking | ISO/IEC 16022; GS1 DataMatrix | 2D imagers and phones |
| QR code | 2D | Up to 7,089 digits or 2,953 bytes | Error correction L, M, Q or H | Links and actions for phone users | ISO/IEC 18004 | Every phone camera; 2D imagers |
EAN-13 and UPC-A: the barcodes scanned at the till
EAN-13 and UPC-A are the barcodes on almost every product sold in shops, and the GS1 General Specifications say the EAN/UPC family must be used for items scanned at the point of sale. Both carry a GTIN, a product number licensed from GS1 (how to get one is covered in how to get a barcode for your product). They hold digits only, have a fixed length, and include a mandatory check digit. Each digit takes seven modules, so a full EAN-13 is 95 modules wide plus quiet zones, with three sets of longer guard bars at the start, middle and end.
There are two names for historical reasons: UPC began in North America and EAN carried the same idea to other countries. They are one system today. A UPC-A holds a 12-digit GTIN, and the GS1 General Specifications say it may be decoded as a 13-digit number by adding a leading zero; the bars of a UPC-A and of an EAN-13 beginning with 0 are the same. GS1 US says that through the Sunrise 2005 initiative, retailers updated their systems to scan and process both. A GS1 support note still warns that an individual retailer’s buying guide may accept only one, so check if you sell to a particular chain.
- EAN-8 and UPC-E are the short versions for packs too small for the full symbol. UPC-E squeezes certain UPC-A numbers, those with runs of zeros in the right places, into six digits; scanners expand it back to the full UPC-A.
- EAN-2 and EAN-5 add-ons are small extra barcodes to the right of the main one: the issue number of a magazine (2 digits) or the price of a book (5 digits).
- Books carry the ISBN as an EAN-13 starting 978 or 979, and serials carry the ISSN as an EAN-13 starting 977.
- Size: at 100% the module is 0.330 mm, and an EAN-13 is 37.29 mm wide including quiet zones with bars 22.85 mm tall. GS1 allows 0.264 to 0.660 mm with the height scaled to match, and does not allow the bars to be cut short (Symbol Specification Table 1).
ITF-14: the barcode on the outer carton
ITF-14 is the long, chunky barcode with a thick black frame on the side of a shipping carton. It holds a 14-digit GTIN that identifies the carton as a trade item, for example a case of 12 of a product whose own EAN-13 is on each pack inside. GS1 describes it as the carrier for items not expected to pass through a till, and as better suited to printing directly onto corrugated board, where print quality is rough.
It is an Interleaved 2 of 5 symbol of exactly 14 digits: digits are encoded in pairs, one in the bars and one in the spaces, using narrow and wide elements in a ratio of 2.25:1 to 3:1. The frame is the bearer bar. For general distribution GS1 sets the module between 0.495 and 1.016 mm, the bar height at no less than 31.75 mm, quiet zones of 10 modules, and bearer bars 4.83 mm thick framing the whole symbol when it is printed with plates (Symbol Specification Table 2). The bearer bars stop a scanner beam that crosses only part of the symbol from returning a short, valid-looking but wrong number, a known weakness of Interleaved 2 of 5.
A carton’s GTIN-14 is usually built from the GTIN of the item inside: an indicator digit from 1 to 8 in front, then the item’s number without its check digit, then a new check digit (GS1 General Specifications, section 2.1.7.2). If the carton itself is sold at a till, as with a multipack, it gets an EAN or UPC instead.
GS1-128: pallets, logistics and extra data
GS1-128 is a version of Code 128 reserved for GS1 data: a special character (FNC1) straight after the start tells the scanner that what follows is a GS1 element string. The string is a chain of Application Identifiers (AIs), each a two- to four-digit code saying what the data after it means: (00) an SSCC, the serial number of a pallet or parcel; (01) a GTIN; (10) a batch or lot; (17) an expiry date in YYMMDD form; (21) a serial number; (310n) a net weight in kilograms; (400) a purchase order number; (410) a delivery location.
Its main job is the GS1 logistic label. The GS1 General Specifications make GS1-128 the mandatory carrier of the SSCC on logistic units, and the SSCC the one element every GS1 logistic label must have. A symbol may hold up to 48 data characters and must be no longer than 165.10 mm including its quiet zones; for SSCC labels the module is 0.495 to 0.940 mm and the bars at least 31.75 mm tall (Symbol Specification Table 5). Fixed-length AIs are best placed first, because a variable-length AI such as a batch number must be followed by another FNC1 when more data comes after it.
The same element strings can go into a GS1 DataMatrix when space is short or more data is needed; the GS1 General Specifications allow a 2D symbol alone on logistic labels smaller than A6.
Code 128 and Code 39: general-purpose barcodes for your own data
When the data is yours, such as a stock-keeping unit, an asset tag, a location or a document number, you do not need GS1. Code 128 is the usual choice. According to ISO/IEC 15417, it can encode all 128 ASCII characters (letters in both cases, digits and punctuation), with byte values 128 to 255 reachable through a special shift character, and every symbol carries a mandatory check character. It has three character sets: A (capitals and control characters), B (capitals and lowercase) and C, which packs two digits into each character. A good encoder switches between them to make the shortest symbol, which is why long numbers with an even count of digits come out compact.
Code 39 is older and simpler. ISO/IEC 16388 limits it to capital letters, digits and seven symbols (space - . $ / + %), 43 characters in all, each drawn with narrow and wide bars and spaces. An optional mod 43 check character can be added, and a “Full ASCII” mode pairs characters to represent lowercase letters and other symbols, but only if the scanner is set to understand it. Code 39 symbols are much wider than Code 128 for the same data. They survive because so much equipment and so many standards use them: the Automotive Industry Action Group’s parts identification guidance lists Code 39 alongside Code 128, Data Matrix and QR, and Zebra’s symbology notes point to its long use in the US military’s LOGMARS labels.
- Code 128 vs Code 39: choose Code 128 unless a customer, a scanner or a standard you must follow asks for Code 39. Code 128 is shorter, holds more characters and always has a check character.
- Interleaved 2 of 5 encodes digits only, in pairs, so it needs an even number of digits; it is compact and common in warehouses, but short ITF codes can be misread from a partial scan, which is why many scanners are set to accept only fixed lengths.
- Codabar is an old symbology for digits and a few symbols between start and stop letters A to D, still found on library books and blood bags.
- MSI Plessey (shelf labels) and Pharmacode (packaging-line control on pharmaceutical cartons) are specialist codes read by scanners set up for them, not by phones.
These codes are where most small businesses start: labelling bins and shelves, tracking stock in and out, and counting. The counts then feed decisions such as how much to reorder and when, covered in EOQ vs reorder point vs safety stock.
Data Matrix: small, dense and hard to damage
Data Matrix is a square or rectangular 2D symbol with a solid L-shaped border on two sides and a dotted border on the other two. ISO/IEC 16022:2024 defines the current version, ECC 200, in sizes from 10 × 10 to 144 × 144 modules for squares, holding up to 3,116 digits, 2,335 letters and digits or 1,555 bytes. Its error correction rebuilds missing modules, so a code can lose part of its area and still read. Because it can be very small, it is used on circuit boards, tools and parts marked directly by laser or dot peen; the US Department of Defense’s item marking standard, MIL-STD-130, requires Data Matrix ECC 200 for its unique item identifiers.
GS1 DataMatrix is Data Matrix carrying GS1 element strings, and it is the code on medicine packs. EU Delegated Regulation 2016/161, applied since 9 February 2019, requires a two-dimensional Data Matrix carrying a product code, a serial number of up to 20 characters, the batch, the expiry date and any national number (Articles 4 and 5). In the US, the Drug Supply Chain Security Act requires a 2D data matrix barcode on drug packages, according to the FDA’s June 2021 guidance on product identifiers. For healthcare items not sold at retail, GS1 sets the module between 0.254 and 0.990 mm with a target of 0.380 mm and a quiet zone of one module (Symbol Specification Table 6).
QR codes: made for phones
A QR code is the 2D code with three large squares in its corners. ISO/IEC 18004:2024 defines 40 versions from 21 × 21 to 177 × 177 modules, the largest holding up to 7,089 digits, 4,296 letters and digits or 2,953 bytes at the lowest of its four error-correction levels (L, M, Q and H, which can restore roughly 7%, 15%, 25% and 30% of the code). Every current phone camera reads QR codes, so they are the right choice whenever a customer will scan the code: a web address, Wi-Fi details, a contact card, a menu, a payment page.
QR codes are also moving onto product packs. GS1 Digital Link puts a GTIN, and optionally a batch or expiry, into a web address, so one QR code can be scanned at a till and by a customer’s phone. GS1 US calls the industry’s target Sunrise 2027: a plan for retail point-of-sale systems to scan and process 2D barcodes by the end of 2027, with the GTIN used for price look-up just as it is from a UPC today. Packs may carry both a UPC and a 2D code during the transition. GS1 notes that healthcare does not use Digital Link in its 2D codes; it uses GS1 DataMatrix.
Our QR code generator makes static codes for links, Wi-Fi, contacts and events, and the QR code data capacity calculator shows how much data fits at each version and error-correction level.
PDF417 and Aztec: where you will see them
Two other 2D codes are common but rarely needed by a business making its own labels. PDF417, a stacked code of many short rows (ISO/IEC 15438), is the mandatory barcode on US and Canadian driving licences under the AAMVA card design standard, and the main symbology in IATA’s standard for paper boarding passes. Aztec (ISO/IEC 24778), a square code with a bullseye in the centre, is one of the codes IATA allows on mobile boarding passes and is used on transport tickets. Our barcode generator deliberately does not make them: their everyday business uses are covered by Data Matrix and GS1-128, and their most visible uses are identity documents and travel passes, which nobody should be generating outside the issuing systems.
Size, quiet zones and print quality across all types
Whatever the type, a barcode fails for the same few reasons: too small for the printer, no clear space around it, too little contrast, or printed on a surface that distorts it. The GS1 figures below are the ones scanners in retail and logistics are built around.
Swipe sideways to compare columns.
| Symbol and use | Module (X) min / target / max | Quiet zones | Notes |
|---|---|---|---|
| EAN-13 / UPC-A at a till | 0.264 / 0.330 / 0.660 mm | EAN-13 11X and 7X; UPC-A 9X each side | Height 22.85 mm at 0.330 mm, scaled with X |
| ITF-14 on cartons | 0.495 / 0.495 / 1.016 mm | 10X each side | Bars at least 31.75 mm; bearer bars |
| GS1-128 SSCC labels | 0.495 / 0.495 / 0.940 mm | 10X each side | Bars at least 31.75 mm; at most 165.10 mm long |
| GS1 DataMatrix, healthcare non-retail | 0.254 / 0.380 / 0.990 mm | 1X all round | Read by 2D imagers only |
| Code 128 and Code 39 (non-GS1) | Set by your scanners and printer | 10X each side | ISO/IEC 16388 gives 10X for Code 39 |
- Quiet zones are part of the barcode. Artwork, text or the edge of a label inside them stops many scanners finding the start of the code.
- Contrast is judged in red light. Laser scanners and most imagers use light around 660 nm, the wavelength GS1 specifies for print-quality tests, so red, orange and yellow bars look as pale as the background and cannot be read. Black, dark blue, dark green and dark brown bars on white or pale backgrounds work; inverted codes are not allowed for EAN and UPC.
- Printers print in dots. Choose a module that is a whole number of printer dots: at 300 DPI, 4 dots is 0.339 mm; at 203 DPI (common on thermal label printers), 3 dots is 0.375 mm.
- Curved and shiny surfaces distort and reflect. Run bars around a bottle, not along it, keep codes off seams and folds, and test on the real material.
- Retailers and logistics customers may ask for a verification grade, measured with a verifier under ISO/IEC 15416 (linear) or ISO/IEC 15415 (2D). For EAN and UPC at a till, GS1 asks for grade 1.5 (C) or better.
Scanners: which ones read which codes
Scanner type matters as much as symbology. The three kinds of handheld and fixed scanner read different things, and phones are a fourth case.
- Laser scanners sweep a red laser line across the code. They read linear barcodes only. Zebra notes that traditional 1D laser scanners cannot read 2D codes or codes shown on a backlit phone screen.
- Linear imagers use a camera that sees one line. They read 1D codes, including from phone screens, but not 2D codes.
- 2D area imagers photograph the whole code. They read both 1D and 2D codes, at any angle and from screens; Honeywell describes its general-purpose 2D scanners as reading virtually all 1D and 2D barcodes. They are now the default in shops, warehouses and pharmacies.
- Phones read whatever their software supports. Google’s ML Kit, used by many Android apps, lists Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A and UPC-E plus Aztec, Data Matrix, PDF417 and QR, with the note that ITF codes shorter than six characters are not recognised. Apple’s Vision framework covers a similar list for iPhone apps, and reports a UPC-A as an EAN-13 with a leading zero. The iPhone’s own Camera app is documented by Apple for QR codes only, so for other barcodes use a scanner app.
In web browsers, the Barcode Detection API lets a page read barcodes from images, but on 1 October 2026 MDN listed it as experimental and supported only in Chrome on Android, macOS and ChromeOS, not on Windows desktop, Firefox or Safari by default. Pages that need to read barcodes everywhere, including our generator’s scan check, bring their own decoder.
Choosing by situation
Swipe sideways to compare columns.
| Situation | Use | Number comes from |
|---|---|---|
| Product sold in shops or on Amazon, Walmart, Google Shopping | EAN-13, or UPC-A in the US and Canada | GS1 (your Company Prefix or a single GTIN) |
| Tiny retail pack | EAN-8 or UPC-E | GS1 |
| Book or magazine | ISBN or ISSN as EAN-13, with a price or issue add-on | Your national ISBN or ISSN agency |
| Outer carton of identical items | ITF-14 (or GS1-128 if batch or dates are needed) | A GTIN-14 from your GS1 prefix |
| Pallet or parcel for a retailer or distributor | GS1-128 with an SSCC on a GS1 logistic label | Your GS1 Company Prefix |
| Medicine or medical device pack | GS1 DataMatrix with GTIN, batch, expiry and serial | GS1 plus your regulator’s rules |
| Stock, bins, shelves and locations in your own warehouse | Code 128 (Code 39 only for older equipment) | Your own system |
| Equipment, tools and IT assets | Code 128 or Data Matrix on durable labels | Your own asset register |
| Small parts and direct marking on metal or plastic | Data Matrix | Your own numbering, or GS1 if parts are traded |
| Anything a customer scans with a phone | QR code | Your own web address or data |
If a customer has given you a labelling specification, follow it instead; large retailers and logistics providers publish their own. For anything carrying a GS1 number, the number must be yours: read how to get a barcode for your product before printing packaging.
Sources
- GS1 General Specifications, Release 26.0, January 2026: https://ref.gs1.org/standards/genspecs/
- ISO/IEC 16022:2024, Data Matrix bar code symbology specification: https://www.iso.org/standard/80926.html
- ISO/IEC 18004:2024, QR code bar code symbology specification: https://www.iso.org/standard/83389.html
- ISO/IEC 15417:2007, Code 128 bar code symbology specification: https://www.iso.org/standard/43896.html
- ISO/IEC 16388:2023, Code 39 bar code symbology specification: https://www.iso.org/standard/77799.html
- Commission Delegated Regulation (EU) 2016/161: https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32016R0161
- FDA, Product Identifiers Under the Drug Supply Chain Security Act, Questions and Answers (June 2021): https://www.fda.gov/media/116304/download
- GS1 US, Sunrise 2027: https://www.gs1us.org/industries-and-insights/by-topic/sunrise-2027
- Google ML Kit barcode scanning: https://developers.google.com/ml-kit/vision/barcode-scanning
- MDN, Barcode Detection API: https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detector_API
Frequently asked questions
What barcode do stores use?
Shops scan EAN-13 and UPC-A at the till, plus their short forms EAN-8 and UPC-E. The GS1 General Specifications require this family for items scanned at the point of sale. Books use the ISBN printed as an EAN-13.
What is the most common barcode?
For products, the EAN/UPC family, since it is on almost every item sold in shops. Inside businesses Code 128 is the most widely used general-purpose barcode, and for phones it is the QR code.
Can a phone scan a Code 128 barcode?
Yes, with a scanner app. Google’s ML Kit and Apple’s Vision framework, which many apps use, both read Code 128. The iPhone’s built-in Camera app is documented for QR codes only.
What barcode do I use for shipping cartons?
For a carton of identical products, ITF-14 with a GTIN-14, or GS1-128 if you also need batch or date information. For a pallet or mixed shipment, a GS1 logistic label with a GS1-128 carrying the SSCC.
How many digits does a barcode have?
It depends on the type: 13 for EAN-13, 12 for UPC-A, 8 for EAN-8 and UPC-E, 14 for ITF-14 and 18 for an SSCC. Code 128, Code 39 and 2D codes have no fixed length.
Why are there two barcode systems, UPC and EAN?
UPC came first in the US and EAN extended it internationally. They are now one GS1 system: a UPC-A reads as an EAN-13 with a leading zero, and GS1 US says retailers updated their systems to handle both through the Sunrise 2005 initiative.
Should I use Data Matrix or a QR code?
Use a QR code when consumers will scan it with a phone, and Data Matrix for industrial and healthcare uses where small size, direct part marking or GS1 element strings matter. Both need a camera-based reader.
What is the difference between 1D and 2D barcodes?
A 1D barcode stores data in the widths of bars along one line and holds little data; a 2D code stores it in a grid of modules, holds far more, survives damage through error correction, and needs a camera rather than a laser scanner.
Can I make a barcode for internal use without paying GS1?
Yes. Code 128, Code 39 and Data Matrix can hold any numbering you choose. Only codes scanned outside your business as product numbers, such as EAN and UPC at a retailer, need GS1-issued GTINs.
More guides on running the product and stock side of a business are in the business guides. Standards are revised: check the current GS1 General Specifications and any specification your customers give you before printing in volume.
Written by
Do The Calculation Team
Do The Calculation
Do The Calculation is built by a small team of data analysts and spreadsheet developers. Where a guide depends on a published formula, standard, or government rule, the calculator it links to names that source directly so you can check the number yourself.
About the team