What Is a 1D Barcode?
A traditional barcode - technically called a 1D barcode or linear barcode - encodes data as a series of parallel lines of varying widths and spacings. A laser or CCD scanner reads across a single horizontal axis to decode the pattern. The most familiar examples are:
- UPC-A - 12-digit product identifier used on retail goods in North America
- EAN-13 - 13-digit version used internationally (the UPC-A is technically a subset)
- Code 128 - High-density alphanumeric barcode used in shipping and logistics
- Code 39 - Older alphanumeric format used in automotive, defense, and healthcare
- ITF (Interleaved 2 of 5) - Numeric only, often used on outer cartons
The defining characteristic of a 1D barcode is that all data is encoded along one axis. This means the scanner must align with the barcode horizontally, and the barcode must be printed cleanly from top to bottom. The height of the bars does not carry data - it exists only to make the code easier to scan at an angle.
What Is a 2D Barcode?
A 2D barcode encodes data in two dimensions - both horizontally and vertically. This allows far more data to be packed into a smaller physical space. The most important 2D formats are:
- QR Code - The dominant consumer-facing 2D code, developed by Denso Wave in 1994
- Data Matrix - Compact square format used heavily in electronics manufacturing, aerospace, and pharmaceuticals
- PDF417 - Stacked 2D format used on driver's licenses, boarding passes, and government IDs
- Aztec Code - Used on transit tickets and airline boarding passes worldwide
- MaxiCode - Used by UPS for parcel sorting
Because data is encoded in both dimensions, a 2D scanner (or camera) reads the entire symbol at once. No precise alignment is needed - the code can be scanned from any angle, upside down, or even partially obscured, thanks to error correction built into the standard.
Data Capacity: A Dramatic Difference
The gap in data capacity between 1D and 2D codes is enormous. A UPC-A barcode holds exactly 12 digits. EAN-13 holds 13. Code 128 is more flexible but rarely encodes more than 30-50 characters in practice before the symbol becomes impractically large.
A QR code, by comparison, can hold:
- Up to 7,089 numeric digits
- Up to 4,296 alphanumeric characters
- Up to 2,953 bytes of binary data
- Up to 1,817 Kanji characters
This means a single QR code can encode an entire URL, a vCard with full contact details, WiFi credentials, or a short paragraph of text - none of which is remotely feasible with a traditional barcode.
Scanning Requirements and Angle Tolerance
A laser barcode scanner must pass its beam across a 1D barcode in the correct orientation. Most retail scanners rotate the beam or use multiple angles to compensate, but the fundamental requirement remains: the bars must be legible along their axis. Dirty, torn, or wrinkled labels significantly degrade read rates.
QR codes can be scanned from any angle because the three finder patterns (the square corners) tell the decoder exactly where the code is and how it is oriented. A camera-based scanner can read a QR code upside down, at a 45-degree tilt, or in a mirror image. Combined with built-in error correction, this makes QR codes dramatically more tolerant of real-world scanning conditions.
Error Correction
Traditional 1D barcodes have minimal error correction. If a bar is smudged or a quiet zone is encroached, the scan fails. Some formats include a single check digit that can detect errors but not correct them.
QR codes use Reed-Solomon error correction at four selectable levels:
- Level L - Recovers up to 7% damaged data
- Level M - Recovers up to 15%
- Level Q - Recovers up to 25%
- Level H - Recovers up to 30%
This is why a QR code can have a logo placed over part of it and still scan reliably - the damaged modules are reconstructed from the redundant data encoded around them.
Industries Where Each Format Dominates
1D Barcodes Dominate In:
- Retail checkout - UPC and EAN are global standards baked into every POS system
- Shipping and warehousing - Code 128 and GS1-128 for parcel tracking
- Supermarket supply chain - From manufacturer to shelf
- Library systems - Book and media tracking
2D Codes Dominate In:
- Marketing and advertising - QR codes on print, packaging, and signage
- Payments - QR-based payment systems (WeChat Pay, PayPal, UPI in India)
- Healthcare - Data Matrix on small medical device labels
- Government IDs and travel - PDF417 on driver's licenses, Aztec on boarding passes
- Electronics manufacturing - Data Matrix on tiny components
- Restaurant menus and hospitality - QR codes for contactless interactions
Printing Requirements
Both formats require high contrast between dark and light elements (typically black on white). The minimum size is where they differ. A UPC barcode has a mandated minimum size defined by GS1 standards - the bars must be tall enough and wide enough for laser scanners to read reliably at checkout speeds.
QR codes are more flexible in size, but the minimum printable size depends on the density of the code (its version) and the scanning distance. A simple URL in a low-version QR code can be printed as small as 1cm x 1cm and still scan with a good camera. More complex codes require larger minimum sizes.
For any format, vector output (SVG or EPS) is preferred for print production to ensure crisp edges at any size. You can generate print-ready QR codes at Vexifa QR Code with SVG export included.
The GS1 Digital Link: A Bridge Between Both Worlds
GS1, the organization that manages global barcode standards, has developed the GS1 Digital Link standard, which encodes a product's GS1 identifier (the same data as a traditional UPC/EAN barcode) inside a URL that fits in a QR code or Data Matrix. This means a single 2D code can serve both as a traditional product identifier for POS systems and as a consumer-facing link to product information, allergen data, or sustainability credentials.
Several major retailers have begun transitioning to accept these "sunrise" 2D codes at checkout, which may gradually change the dominance of 1D barcodes in retail over the coming years - though full replacement remains a long-term project given the scale of infrastructure involved.
Frequently Asked Questions
Can a phone scan a regular barcode?
Yes. Most modern smartphone camera apps and free barcode scanning apps can read common 1D barcodes including UPC-A, EAN-13, and Code 128. Google Lens and the native iOS camera can both decode standard barcodes, though they may display limited information rather than the full product database entry that a retail POS system would retrieve.
Are QR codes replacing barcodes?
QR codes are supplementing barcodes in many consumer-facing contexts, but they are not replacing them in supply chain, retail checkout, or logistics operations. The GS1 Digital Link standard may allow 2D codes to appear at checkout alongside traditional barcodes, but traditional 1D codes remain deeply embedded in global retail infrastructure and will coexist for many years.
Which holds more data - a QR code or a barcode?
A QR code holds significantly more data. A standard UPC-A barcode holds exactly 12 digits, while a QR code at maximum capacity can hold up to 7,089 numeric digits or 4,296 alphanumeric characters - making it hundreds of times more capable than a traditional 1D barcode. This is the fundamental reason QR codes can encode URLs, contact details, and WiFi credentials while barcodes cannot.
Why do grocery stores still use barcodes?
Grocery stores use 1D barcodes because the global retail checkout infrastructure - scanners, point-of-sale systems, product databases - was built around UPC and EAN standards over decades. Switching to a new format requires replacing hardware and software across millions of stores worldwide, a massive investment. The barcode does its job reliably at checkout, and the 12-digit product identifier is all a POS system needs since the product details live in a central database.