· Updated · 11 min read

Types of Barcodes Explained: Every Common 1D and 2D Format Compared

Most guides list barcode formats. This one starts from the barcode in your hand: how to tell which format it is by its shape, where you meet each one, what it can hold, and which to choose for your own label.

Several hundred barcode symbologies have been defined, but fewer than a dozen account for almost everything you will meet on a product, a ticket, an ID card or a parcel. This guide covers that working set. It starts with the practical question most people actually have, which is what is this barcode in front of me, then compares the formats side by side and ends with which one to pick for your own label.

Identify the Barcode You Are Holding

Every common symbology has a visual signature. Match the shape first, then the context, and you will rarely be wrong. Where the right-hand column links to a decoder, you can paste what your scanner reads and see each field spelled out.

What you see Format Where you meet it Go deeper
Square with three large squares in the cornersQR CodeLinks, menus, payments, WiFi, mobile ticketsQR payload decoder
Square with a single bullseye in the centre and no blank borderAztecRail tickets, mobile boarding passesWhat's in a train ticket
Small square or rectangle with two solid edges forming an L, the other two dottedData Matrix / GS1 DataMatrixMedicine packs, medical devices, electronicsGS1 decoder
Wide rectangle of stacked rows with thick start and stop columnsPDF417US and Canadian driver's licences, printed boarding passesLicence decoder, boarding pass decoder
Bars over 13 digits, first digit printed outside the barsEAN-13Retail products worldwide, books (978/979)Prefix checker
Bars over 12 digits, small digits at both endsUPC-ARetail products in the US and CanadaGTIN converter
Short symbol over 8 digitsEAN-8 or UPC-ESmall packs: gum, cosmetics, cigarettesBarcode validator
14 digits inside a thick black frame (bearer bars)ITF-14Outer cartons and shipping casesGTIN converter
Long dense barcode with digits in brackets, such as (00) or (01)GS1-128Pallet labels, case labels, parcel labelsSSCC pallet labels
Long barcode on a shipping label, letters and digits mixedCode 128Courier tracking numbers, warehouse labelsTracking number checker
Wide, low-density barcode with asterisks around the textCode 39ID badges, vehicle VIN labels, defence (LOGMARS)What's in a VIN barcode
Digits with a letter A to D at each endCodabarLibrary cards, blood bags, older airbillsCodabar in Apple Wallet

Still not sure? Describe the symbol to the barcode format identifier (its shape, its finder pattern, how many digits it prints) and it ranks the likely formats, with which phones can read each.

1D vs 2D: The One Distinction That Matters

A 1D (linear) barcode stores data only in the widths of its bars and spaces, so the symbol grows wider as you add data and practical capacity is a few dozen characters. A 2D code stores data in both directions, holds thousands of characters in a compact square, and carries Reed-Solomon error correction that rebuilds damaged areas. A 1D barcode has at most a check digit, which detects a misread but cannot repair one.

Feature1D barcode2D code
Typical capacity8 to about 48 charactersHundreds to thousands of characters
Data typesMostly digits; Code 128 and Code 39 add lettersText, URLs, structured fields, binary
Damage handlingCheck digit detects errors, cannot fix themReed-Solomon recovers lost areas
ReadersLaser, linear imager or cameraCamera or 2D imager only
OrientationOmnidirectional at retail checkouts; a handheld laser needs a line across the barsAny rotation
FootprintWidth grows with dataSquare or rectangle, grows in both directions

PDF417 sits between the two: it is a stack of short linear rows, so some line-scanning hardware can read it by sweeping across, but it carries 2D-scale data and error correction.

1D Barcodes

EAN-13

The global retail standard: 12 digits plus a check digit, found on almost every product sold outside North America. The leading digits are a GS1 prefix that identifies the GS1 member organisation that issued the number, not the country where the product was made. That misconception is common enough that we wrote a whole guide on barcode country codes. Books use EAN-13 too, with the prefix 978 or 979 turning an ISBN into a barcode.

UPC-A

The North American retail standard: 11 digits plus a check digit. A UPC-A is an EAN-13 with a leading zero that is not printed, so checkout scanners everywhere read both. If you sell internationally, the distinction is cosmetic. The GTIN converter moves a number between the forms.

EAN-8 and UPC-E

Short forms for packs too small for a full symbol. EAN-8 is its own 8-digit number issued by GS1 on request. UPC-E is different: it compresses certain UPC-A numbers that contain runs of zeros into 6 digits, and expands back to the full UPC-A when scanned.

Code 128 and GS1-128

A dense, variable-length format that encodes the full 128-character ASCII set and switches between three internal code sets, packing pure digits two per symbol character. A mandatory modulo-103 check character makes it very reliable. When it starts with the special FNC1 character it becomes GS1-128, where bracketed application identifiers such as (00) for a serial shipping container code or (17) for an expiry date give each field a defined meaning. GS1-128 caps the data at 48 characters.

Code 39

One of the oldest alphanumeric formats: uppercase A to Z, digits, and seven symbols (space, minus, full stop, $, /, + and %). It needs no check character, which made it easy to adopt and keeps it alive in defence logistics (LOGMARS), automotive labels, ID badges and the VIN barcode on many vehicles. The price is low density: the same data takes far more width than in Code 128.

ITF-14 (Interleaved 2 of 5)

A numeric-only format that encodes digits in pairs, one in the bars and one in the spaces, so it always holds an even number of digits. The 14-digit version identifies outer cases. Its thick bearer bars stop a scanner from reading a partial symbol on the corrugated cardboard it is usually printed on. The first digit is a packaging indicator, so reading the next three as a country prefix is a classic mistake.

Codabar

Digits plus six symbols (- $ : / . +), with letters A to D as start and stop characters. It predates most modern formats and survives where systems never migrated: library cards, blood banks and some older courier airbills. Apple Wallet only learned to display it in iOS 27, as covered in which barcode formats Apple Wallet supports.

2D Codes

QR Code

The most widely recognised 2D code, built for fast reading at any angle. Capacity runs to 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes at the largest version and lowest error correction. Four error-correction levels recover roughly 7, 15, 25 or 30 percent damage, which is also what lets a logo sit in the middle. It is the only 2D format that every phone camera app recognises out of the box. For what the different payloads look like, see QR code data formats.

Data Matrix

Optimised for small sizes: it can be printed or laser-etched only a few millimetres across and still read reliably, which is why it marks electronic components, surgical instruments and medicine packs. Maximum capacity is 3,116 digits, 2,335 alphanumeric characters or 1,556 bytes. The GS1 variant carries the same application identifiers as GS1-128. What GS1 DataMatrix is explains the difference.

PDF417

A stacked format of 3 to 90 rows. It holds up to 2,710 digits, 1,850 text characters or 1,108 bytes, and its rectangular shape fits the back of an ID card. That is why every US and Canadian driver's licence carries one under the AAMVA standard, and why the data inside is readable by anyone. See what your driver's licence barcode contains. Printed boarding passes use it too: see what is in a boarding pass barcode.

Aztec Code

Recognisable by its central bullseye. The bullseye lets a reader find the symbol without a blank quiet zone around it, so Aztec suits phone screens and tightly laid-out tickets. Capacity is up to 3,832 digits, 3,067 letters or 1,914 bytes. Error correction is adjustable, from about 5 to 95 percent. European rail operators and many airlines' mobile passes use it.

Side-by-Side Comparison

Format Type Characters Maximum data Error handling Best for
EAN-131DDigits13 digitsMod-10 check digitRetail products worldwide
UPC-A1DDigits12 digitsMod-10 check digitRetail in US and Canada
EAN-8 / UPC-E1DDigits8 digitsMod-10 check digitVery small packs
Code 1281DFull ASCIIVariable (48 in GS1-128)Mod-103 check, mandatoryLogistics, shipping, inventory
Code 391DA–Z, 0–9, 7 symbolsVariable, low densityOptional mod-43Badges, defence, automotive
ITF-141DDigits14 digitsMod-10 check digitShipping cartons
Codabar1DDigits, 6 symbolsVariableNone requiredLibraries, blood banks
QR Code2DAny7,089 digits / 2,953 bytesReed-Solomon, 7–30%Anything a phone will scan
Data Matrix2DAny3,116 digits / 1,556 bytesReed-SolomonTiny parts, medicines
PDF417Stacked 2DAny2,710 digits / 1,108 bytesReed-Solomon, levels 0–8ID cards, boarding passes
Aztec2DAny3,832 digits / 1,914 bytesReed-Solomon, 5–95%Tickets, phone screens

Which Barcode Should You Use?

  • Selling through retailers: EAN-13, or UPC-A in North America, built on a GS1 company prefix. Retail systems reject numbers that are not globally unique.
  • Shipping cases and pallets: ITF-14 on cases, GS1-128 on pallet and logistics labels.
  • Internal inventory and assets: Code 128 for item labels, QR for shelf and bin labels that also carry a location or link. Any format works because only your own scanners read it.
  • Anything a customer scans with a phone: QR. It is the only format every default camera app recognises.
  • Marking very small items: Data Matrix.
  • Tickets shown on a phone screen: Aztec or QR, both of which tolerate glare and need little or no quiet zone. Why some barcodes fail on screens is covered in why a barcode on your phone screen will not always scan.

One trap when picking a format: not every phone reads every symbology. The GS1 DataBar family and Micro QR decode on iOS but not through Android's ML Kit, and MaxiCode decodes on neither. Which barcodes your phone can actually scan has the per-platform breakdown.

One axis this comparison deliberately leaves out is physical size, because it depends on your data rather than on the symbology alone: the same seventeen characters are about a third narrower in Code 128 than in Code 39, and a Code 128 symbol carrying digits is narrower again than one carrying letters. If the label is the constraint, how big a barcode needs to be covers the arithmetic and the barcode size calculator gives you the printed width for a specific value.

Frequently Asked Questions

What is the difference between a barcode and a QR code?

A QR code is a barcode. The word covers any machine-readable optical symbol. The useful distinction is dimensional: traditional barcodes such as EAN-13 or Code 128 encode data only in the widths of vertical bars, so capacity is small. QR codes encode in both directions, which is why they hold thousands of characters in a compact square and survive partial damage through built-in error correction.

How many types of barcodes are there?

Several hundred symbologies have been defined, but fewer than a dozen cover almost everything you will encounter: EAN-13, UPC-A, EAN-8, UPC-E, Code 128, Code 39, ITF-14 and Codabar among 1D formats, and QR Code, Data Matrix, PDF417 and Aztec among 2D formats. Anything outside that list is usually specific to one industry.

Is EAN-13 or UPC-A better for a retail product?

Neither is better. They are the same numbering system at different lengths, and modern checkout scanners read both. UPC-A is conventional in the United States and Canada and EAN-13 everywhere else, so if you sell internationally an EAN-13 is the safer default.

When should I use Code 128 instead of EAN-13?

Whenever the code is not a retail product number. EAN-13 encodes exactly thirteen digits, so it cannot carry a batch number, a date or a location. Code 128 encodes variable-length alphanumeric data, which is why logistics labels use it, usually as GS1-128 with application identifiers that give each field a defined meaning.

Why do some products have two different barcodes?

Because they identify different things. The EAN-13 on a consumer unit identifies the product, while an ITF-14 or GS1-128 on the outer case identifies the case as a distinct trade item, with a packaging indicator digit in front. Warehouses scan the case code and checkouts scan the item code.

Which barcode type holds the most data?

QR Code, among widely supported formats: up to 7,089 digits or 4,296 alphanumeric characters at the largest version and lowest error correction. Aztec and Data Matrix come next. PDF417 holds less but its rectangular shape suits ID cards. You can check a specific payload with our QR code capacity calculator.

Can a phone camera read every barcode type?

Not by default. The built-in camera app on most phones is tuned for QR codes and often ignores everything else. Reading EAN-13, Code 128, PDF417, ITF-14 or Data Matrix generally needs a scanner app that supports those symbologies, which is the most common reason a code that scans at a checkout seems unreadable on a phone.

What do the numbers under a barcode mean?

On a retail barcode they are the GTIN, printed so the number can be keyed in if the scan fails. The leading digits are the GS1 prefix of the issuing organisation, not the country of manufacture. The final digit is a check digit calculated from the others, which you can verify with the barcode validator.

Do I need to pay for a barcode?

Only if retailers will scan it. A barcode used inside your own business can use any format at no cost, because nobody outside needs to interpret it. A product sold through retailers needs a GTIN built on a company prefix licensed from GS1. QR codes for links, WiFi or contact details are always free to generate.

Can I convert one barcode format to another?

You can re-encode the same data in a different symbology when the data fits. A thirteen-digit GTIN can be drawn as an EAN-13, a Code 128 or a QR code and all three carry the same number. A QR code holding a URL cannot become an EAN-13, because EAN-13 holds thirteen digits and nothing else.

Find Out What Your Barcode Contains

Paste a scan into the format identifier, or decode a boarding pass, driver's licence or GS1 label field by field. Free and private, in your browser.

Scan All Barcode Formats

Scan & Generate reads EAN-13, UPC-A, Code 128, Code 39, ITF, Codabar, QR Code, Data Matrix, PDF417 and Aztec with your phone's camera.