1D vs 2D Barcodes: What Is the Difference?

A barcode format defines how data is represented and how a compatible reader interprets the symbol. “1D” and “2D” describe the symbol structure, but the correct choice still depends on the receiving system, required data, print space, and scanner support.

The practical comparison

Comparison of 1D linear barcodes and 2D matrix or stacked barcode formats.
Characteristic 1D or linear 2D, matrix, or stacked
Visual structure Bars and spaces read across a line. Cells, dots, hexagons, or stacked rows interpreted across two axes.
Typical data Short identifiers, often used as keys for a database record. Identifiers, text, URLs, structured fields, or binary data, subject to the chosen format.
Reader type May be read by a compatible laser scanner, imager, or camera decoder. Normally requires an imager or camera-based decoder that supports the exact format.
Error control Varies by symbology; some use check digits or check characters. Many formats include configurable or built-in error correction, but capability varies.
Common examples UPC-A, EAN-13, ITF-14, Code 39, Code 128, Codabar. QR Code, Data Matrix, PDF417, Aztec, MaxiCode.

How 1D barcodes work

A linear barcode represents data through the widths and positions of bars and spaces. Retail formats such as UPC and EAN carry fixed-length numbers, while formats such as Code 39 and Code 128 can carry other identifier structures. The associated product description or price is usually stored elsewhere and retrieved after the identifier is read.

Physical width grows with the amount of encoded data, the selected symbology, and the printing scale. A receiving system may also impose exact dimensions, quiet zones, check characters, or label-layout rules.

How 2D and stacked formats work

Two-dimensional formats arrange modules across a grid or multiple rows. This structure can carry more data in a compact area than a typical linear symbol, but more data also creates a denser symbol that requires adequate module size, contrast, focus, and print quality.

Error correction can help recover data when part of a symbol is obscured, but it is not a guarantee. Readability depends on the format, correction setting, damage location, remaining finder patterns, quiet zone, image quality, and decoder implementation.

Choose the downstream requirement first

Choose a 1D format when

  • The receiving system expects UPC, EAN, ITF, Code 39, Code 128, or another linear format.
  • The symbol carries a short identifier and the related record lives in a database.
  • Existing scanners or label specifications are designed for a linear symbology.

Choose a 2D format when

  • The receiving system explicitly supports QR Code, Data Matrix, PDF417, Aztec, or another 2D format.
  • The symbol must carry more than a short lookup identifier.
  • A compact symbol or a format-specific error-correction capability is required.

For a format-by-format view of what this site can scan and generate, see the barcode types comparison.

Do not choose by appearance alone

A barcode can be visually clean and mathematically valid yet still be unusable for a specific workflow. Confirm the required symbology, data structure, dimensions, print process, and verification rules with the system that will consume the code.