Code 128 vs QR Code: When to Use Each
Compare Code 128 and QR Code on data capacity, scanning hardware, and error correction. Learn which barcode format fits logistics, retail, or marketing.
Code 128 and QR Code solve barcode scanning in two different dimensions, literally. Code 128 packs data into a single line of bars and spaces that has carried shipping labels and logistics data for decades. QR Code packs data into a square grid that any smartphone camera reads without a dedicated scanner. Picking the wrong one usually shows up as a barcode that can't hold the data you need, or one that your existing scanning equipment can't read at all.
What is the difference between Code 128 and QR Code?
Code 128 is a one-dimensional (1D) linear barcode: a series of vertical bars and spaces read along a single horizontal line. QR Code is a two-dimensional (2D) matrix barcode: a grid of black and white squares read in both directions at once, which is why it stores so much more data in a similar amount of printed space.
That structural difference shapes everything else about the two formats. Code 128 is standardized as ISO/IEC 15417 and encodes the full 128-character ASCII set using three switchable subsets, including a double-density numeric mode. QR Code is standardized as ISO/IEC 18004 and was invented in 1994 by Denso Wave for tracking automotive parts on a Toyota production line, long before it became a consumer scanning format.
| Feature | Code 128 | QR Code |
|---|---|---|
| Dimension | 1D, linear bars and spaces | 2D, matrix grid |
| Invented | 1981 | 1994, Denso Wave |
| Max data capacity | Practical limit of a few hundred characters | ~7,089 numeric / ~4,296 alphanumeric |
| Error correction | Single mandatory check character | Reed-Solomon, 4 selectable levels (7-30%) |
| Scanner type | Laser or 2D imager | Requires a 2D imager or camera |
| Smartphone-native scan | No, needs a scanning app | Yes, default camera apps |
| Can embed a logo | No | Yes, with error correction to spare |
| ISO standard | ISO/IEC 15417 | ISO/IEC 18004 |
| Typical use | Shipping, logistics, GS1-128 | URLs, marketing, payments, tickets |
Which holds more data, Code 128 or QR?
QR Code holds far more data than Code 128 in practical use. A full-size, Version 40 QR symbol at the lowest error correction level can store roughly 7,089 numeric digits, 4,296 alphanumeric characters, or about 2,953 bytes of binary data. Code 128 has no hard length limit written into the standard, but every added character makes the linear barcode wider, so real deployments stay short.
In the real world, Code 128 rarely needs to carry more than a few dozen characters because its job is usually encoding an identifier, such as a shipping container number or a GS1-128 application identifier string, not a block of text. QR Code is routinely used closer to its real capacity because its job is often the opposite: storing a full URL, a vCard, or a Wi-Fi password directly in the symbol so the data travels with the code instead of pointing to a database lookup. That's the core trade-off: Code 128 stays narrow by staying short, while QR Code earns its square footprint by holding much more.
How do Code 128 and QR Code handle scanning hardware?
Code 128 can be read by either a simple laser scanner or a modern 2D imager, while QR Code can only be read by a 2D imager or camera. This difference matters most in warehouses and retail backrooms that still run older equipment, since a laser scanner that has handled Code 128 labels for years simply cannot decode a QR code.
A laser scanner works by sweeping a single beam of light across a barcode and measuring reflected light along that one line, which is exactly how a 1D symbology like Code 128 is built to be read. A QR code carries its data across two dimensions at once, so decoding it requires an image sensor that captures the whole grid, locates the three corner finder patterns, and reconstructs the matrix in software. Most handheld scanners sold in the last 10 to 15 years are 2D imagers by default, and every smartphone camera is as well, so this is mostly a concern for sites running legacy laser hardware rather than new installations.
When should I use Code 128 vs a QR code?
Choose Code 128 when you're working inside an established logistics or supply chain pipeline that already expects a linear barcode, and choose QR Code when the end user doing the scanning is a person with a phone rather than a fixed scanning station. The two formats rarely compete head-to-head because they tend to show up at different points in the same supply chain.
Code 128 is the right call for shipping labels, pallet tags, and carton labels, particularly as the base symbology for GS1-128, which structures application identifiers for SSCC numbers, batch codes, and expiration dates. It's also a safe choice anywhere your scanning infrastructure, staff training, and label printers are already built around 1D barcodes. QR Code is the right call for anything meant to be scanned by a customer's own device: product packaging that links to care instructions, restaurant menus, event tickets, payment prompts, and marketing materials where a printed logo inside the code matters for brand recognition. If you're deciding between 2D formats more broadly, see our guide to choosing the right barcode type.
How does error correction differ between Code 128 and QR Code?
Code 128 relies on a single mandatory check character calculated from the encoded data, which detects errors but cannot fix them. QR Code uses Reed-Solomon error correction at one of four selectable levels, L, M, Q, or H, which can recover roughly 7% to 30% of the symbol even if part of it is damaged, dirty, or obscured.
That gap has practical consequences. A Code 128 barcode with a torn label edge or a smudged bar typically fails to scan outright, since the format has no way to reconstruct missing data. A QR code built at a higher error correction level can lose a meaningful chunk of its surface, including a corner covered by a brand logo, and still decode correctly, which is exactly why QR codes on marketing materials can carry a logo in the center while Code 128 cannot absorb any visual decoration at all without breaking.
Can the same scanner read both Code 128 and QR codes?
Yes, as long as the scanner is a modern 2D imager, which has become the default across smartphones, point-of-sale terminals, and current-generation handheld scanners. These devices capture a full image rather than tracing a single line, so they can decode both 1D symbologies like Code 128 and 2D symbologies like QR Code without any hardware change.
The exception is older laser-based scanners, which are still common in some warehouses and retail backrooms that haven't upgraded in over a decade. Those devices can read Code 128 and other linear barcodes but cannot read a QR code under any configuration, since the underlying hardware only captures a single scan line rather than a two-dimensional image. If you're testing either format before committing to new equipment, you can scan both with a web-based barcode scanner that works from a camera or an uploaded image.
Generating Barcodes
Create barcodes in either format with our free generators:
- Code 128 Generator - enter any text and download as SVG, PNG, or PDF
- Barcode Generator hub - browse every supported format, including GS1 QR codes
Both generators handle encoding and sizing automatically, so you can download the result and drop it directly into a label or marketing design.
Related Guides
- Barcode vs QR Code - a broader look at linear barcodes versus QR codes
- Code 128 vs Code 39 - comparing Code 128 with the other common alphanumeric linear format
- 1D vs 2D Barcodes - the general case for choosing between linear and matrix barcode formats
Sources
- ISO/IEC 15417:2007 - Code 128 bar code symbology specification - the international standard defining Code 128 structure and encoding.
- ISO/IEC 18004:2024 - QR Code bar code symbology specification - the international standard defining QR Code structure and error correction.
- Denso Wave: QR Code history - the inventor's official account of QR Code's 1994 origin and development.
- GS1 General Specifications - the GS1 standard covering GS1-128, the Code 128-based format used in supply chain logistics.