1D vs 2D Barcodes: Choosing the Right Format for Your Labels
Two labels land on your desk. One carries a single row of black bars, the other a small grid of black squares. Both encode the same SKU. Both scan fine at the desk. Then one of them fails at the loading dock, or at the returns counter, or on the phone camera of a customer who is trying to check whether the product is in stock.
That failure is almost never a printer problem. It’s a format problem.
Understanding how barcode formats work in label design is the difference between a label that scans everywhere and a label that scans in exactly one place, under exactly one light, with exactly one scanner. This article is about that decision: what a barcode format actually is, how 1D and 2D symbologies differ, when each one wins, and how to implement the choice without hand-rolling an encoder.
What “Barcode Format” Actually Means on a Label
A barcode format — the technical term is symbology — is a set of encoding rules. It defines how characters become bars, squares, or dots, where the quiet zones go, whether a check digit is required, and what the scanner must do to decode the result.
That last part matters: a barcode is a contract between an encoder and a scanner. Drawing black rectangles that look like a barcode is not the same as producing a valid symbol. If the module widths are wrong, the check digit is missing, or the quiet zone got clipped by the label edge, the scanner sees noise.
Symbologies fall into two families:
- 1D (linear) codes — data lives in the widths and spacing of parallel bars. Think UPC at the supermarket, Code 128 on a carton.
- 2D (matrix) codes — data lives in a grid of modules, with finder patterns and error correction. Think QR Code on a poster, Data Matrix on a machined part.
The choice affects three things at once: which scanners can read the label, how much space it consumes, and how much data you can carry. It also affects how forgiving the symbol is when a label gets scuffed, wrapped around a curve, or printed at the edge of a thermal printer’s capability.
Two clarifications that save a lot of rework:
- A label can mix formats. A retail carton might carry an EAN/UPC for the point-of-sale system and a QR or Data Matrix code for traceability, serial numbers, or a customer-facing URL. This is normal, not a compromise.
- The design tool has to support both families properly. Not just place an image — generate the correct symbology, with correct proportions, quiet zones, and human-readable text. The full list of supported symbologies in Next Generation Label Printing System is documented in the Barcode Formats reference; check it before you commit to a layout.
A Simple Analogy: Grocery Aisle vs. Shipping Label
The grocery checkout is the 1D story. A UPC or EAN code carries a fixed-length article number. It’s fast to scan, cheap to print, and works with the laser scanners that have been bolted to checkout counters for decades. Nobody needs the barcode to contain the product name, the price, or the expiry date — those live in a database keyed by that number. The barcode’s only job is to be a reliable pointer.
The shipping label or event ticket is the 2D story. A QR Code on a parcel can hold an order number, a destination code, a tracking URL, and a serial — all in the same footprint as a much smaller 1D code. It includes error correction, so a partially smudged or torn code can still decode. And it can be read by a phone camera, which is why event tickets, restaurant menus, and package inserts moved to QR in the first place.
Mapped to label design decisions, the analogy looks like this:
- Space: a 1D code grows horizontally as you add characters; a 2D code grows in both directions but stays compact.
- Scanner type: 1D assumes a dedicated laser or imager scanner at a fixed station; 2D assumes cameras, phones, and handheld imagers.
- Data volume: 1D is a pointer; 2D can be the record.
- Durability: 2D’s error correction tolerates damage that would silently kill a 1D symbol.
Where the analogy breaks down is industrial labeling. On a tiny machined part, a curved cable, or a label that will spend a decade in a warehouse, 2D codes often win even when the data is trivial — because Data Matrix is designed for small, dense, direct marking. Conversely, a legacy retail environment with fixed laser scanners will punish you for shipping a beautiful QR-only label.
How 1D and 2D Barcodes Work Under the Hood (Briefly)
1D symbologies encode data in the relative widths of bars and spaces along one axis. The scanner sweeps a line across the symbol and measures transitions. This puts hard limits on the design:
- Capacity is limited and often fixed-length or near-fixed-length per symbol.
- Quiet zones are mandatory. Without clear margin on both sides, the scanner can’t find the start and stop patterns.
- Print quality is unforgiving. Uneven bar edges from a worn thermal head or low-resolution output turn a valid code into a failed scan.
- The vertical dimension is a tolerance, not a data channel. Taller bars help handheld scanning; they don’t carry more data.
Common 1D examples include Code 128, Code 39, and EAN/UPC.
2D symbologies encode data in a grid of modules in both dimensions, framed by finder patterns (the three big squares on a QR Code) that let the scanner locate and orientation-correct the symbol. The rest of the grid holds data plus error-correction codewords, which is what allows a damaged symbol to still decode.
Common 2D examples include QR Code, Data Matrix, and PDF417.
The practical consequence for label design: your tool must generate the symbol, not draw a picture of one. That means computing check digits, laying out modules at an integer number of printer dots, reserving quiet zones, and rendering the human-readable interpretation underneath — so a human can still key in the number when the scanner won’t cooperate.
Why the Choice Matters (and Common Misconceptions)
Misconception 1: “2D is always better.” It’s newer and it holds more data, so it must be an upgrade. In practice, 1D remains the right answer for retail point-of-sale and any environment built around legacy laser scanners. Swapping an EAN/UPC for a QR Code at the checkout lane doesn’t modernize anything — it breaks the lane.
Misconception 2: “Any barcode works on any printer.” Print resolution, contrast, and substrate determine whether a symbol is readable. 2D codes are especially sensitive here: each module is a small cluster of printer dots, and if the printer can’t resolve them cleanly, the error correction has to work harder than it should. The label material matters too — glossy stock and direct thermal paper behave differently under the same print head.
Misconception 3: “I can just scale the barcode image to fit.” Resizing a symbol changes module widths relative to the printer’s dot grid. What looks fine on screen becomes marginal on paper. Set the size in the design tool so the renderer produces it correctly.
Why this matters beyond aesthetics: a wrong format produces scan failures at the point where the label is supposed to do its job, wasted labels on every print run, and broken integrations downstream when a warehouse system receives data it can’t parse. Debugging that after a rollout is far more expensive than picking the format up front.
This is the part Next Generation Label Printing System takes off your plate. You choose a format from the supported list, place the field, and bind it to data — the system handles the encoding and rendering. No raw barcode-generation code, no protocol-level fiddling with the printer.
Putting It Into Practice in RSJ LPSNG
In Next Generation Label Printing System, barcode handling is part of the label design, not a separate script you maintain. The workflow:
- Add a barcode field in the label studio.
- Pick the format from the supported list (see the Barcode Formats reference for the exact set).
- Bind the field to data — a static value, an Excel data file, or a payload from the web service API. The Excel walkthrough covers the file-based path in detail.
- Add human-readable text if your downstream process needs it.
- Preview, then print through the managed workflow.
To render or print a label programmatically, you submit a job through the Web Service Interface. The shape is familiar if you’ve worked with any REST API:
# Illustrative — see the Web Service Interface reference for the exact
# endpoint, payload schema, and authentication flow.
export LPSNG_API="https://<your-lpsng-instance>"
export ACCESS_TOKEN="<token from the OAuth2 flow>"
curl -sS -X POST "$LPSNG_API/<print-job-endpoint>" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"template": "product-label",
"output": "pdf",
"data": {
"sku": "A-100",
"gtin": "4006381333931",
"serial": "SN-00042"
}
}' \
--output label.pdf
The label template decides which format each field uses — the API just supplies values. That separation is what keeps your integration stable when a layout changes.
For dynamic labels, attach a Python field script to compute or validate the barcode value before printing. The Python API reference covers the entry point and available context; the logic itself is plain Python:
# Sketch of a validation step on a barcode field.
# Check the Python API reference for the exact entry point and context object.
def prepare_ean13(raw_value: str) -> str:
digits = "".join(ch for ch in raw_value if ch.isdigit())
if len(digits) == 13:
return digits # already complete
if len(digits) != 12:
raise ValueError(f"EAN-13 needs 12 digits plus check digit, got {len(digits)}")
total = sum(int(d) * (3 if i % 2 else 1) for i, d in enumerate(digits))
check = (10 - total % 10) % 10
return digits + str(check)
Now a bad data row fails loudly at render time instead of printing a hundred unscannable labels.
For high-volume batch work, the LPSNG Player takes a package plus data and produces PDF, PNG, JSON, print output, or ESL updates — same templates, same formats, no interactive session.
You can do all of this the hard way with a raw barcode library, a PDF toolkit, and your own layout math. That’s a legitimate choice if you enjoy maintaining check-digit implementations. It is not a requirement here.
Matching Format to Use Case: A Quick Decision Guide
| Situation | Prefer | Why |
|---|---|---|
| Retail POS, fixed checkout scanners | 1D — EAN/UPC, Code 128 | Speed, cost, compatibility with existing lanes |
| Shipping labels, traceability, serialized goods | 2D — QR Code, Data Matrix | Data capacity and error correction |
| Small parts, curved or harsh surfaces | 2D — typically Data Matrix | Dense, compact, damage-tolerant |
| Customer-facing “scan for more info” | 2D — QR Code | Phone cameras read it natively |
| Mixed environment | Both on one label | POS gets its 1D code, logistics gets its 2D code |
Two rules of thumb that survive most projects:
- Test with the actual scanner. Not a phone app that happens to work. The scanner at the dock, at the register, on the handheld in the warehouse.
- Design for the worst case. A slightly worn thermal head, a slightly curved surface, a slightly rushed operator. That’s the label that gets scanned thousands of times.
Cross-media is worth a mention too: with electronic shelf labels, the same label design and data can drive an ESL display instead of or alongside a printed label. The ESL overview covers how that fits together.
FAQ
Can I use both 1D and 2D barcodes on the same label in RSJ LPSNG?
Yes. The label studio lets you add multiple barcode fields to a single label design, each with its own format from the supported list. You can combine a 1D code for POS scanning with a 2D code for traceability, then preview and print through the managed workflow.
Which barcode formats does RSJ LPSNG support?
RSJ LPSNG supports a range of 1D and 2D formats; the full list is documented on the Barcode Formats page. Common examples include Code 128 and EAN/UPC for 1D, and QR Code and Data Matrix for 2D. Always check the reference for the exact set before designing your label.
Do I need to write code to generate barcodes, or can I use the managed workflow?
You can use the managed workflow: add a barcode field in the label studio, choose the format, and bind it to your data. For advanced logic, attach a Python field script to compute or validate the value. Raw barcode libraries are an alternative but not required.
How do I test barcode readability before printing a full batch?
Use the label studio’s preview and the web service API or LPSNG Player to render a sample label as PDF or PNG, then scan it with your target scanner. This catches format, size, and resolution issues before committing to a full print run. If you’re wiring up a print pipeline, the web service print job guide walks through the submission side.
Conclusion
Choosing between 1D and 2D isn’t a question of which technology is newer — it’s a question of who scans the label, with what hardware, and how much data has to survive the trip. 1D codes are compact pointers optimized for fixed scanners and retail throughput. 2D codes are dense, self-correcting records that tolerate damage and read from a phone. Most real labeling operations end up using both, on the same label, for different audiences.
Next Generation Label Printing System handles the encoding side so you can focus on the decision itself: pick the format, bind the data, preview, print. Start with the Barcode Formats reference to confirm the symbologies you need, then design your first mixed-format label in the browser.
Related posts
- White Label Label Printing Software for Printer Manufacturers
- Automate Label Printing From Excel Data Files: A Walkthrough
- How to Submit Label Print Jobs Through a Web Service API
