PDF417 vs QR vs Code 128: Which Barcode Should You Use?
Choosing the right barcode for a label, document, or product package determines whether scanning works seamlessly or fails in the field.
Here is a direct comparison of PDF417, QR Codes, and Code 128 to help you choose the best format.
Comparison at a Glance
| Feature | PDF417 | QR Code | Code 128 | | :--- | :--- | :--- | :--- | | Dimension | 2D (Stacked) | 2D (Matrix) | 1D (Linear) | | Max Capacity | ~1,100 bytes (binary) | ~3,000 bytes (binary) | ~80 alphanumeric | | Ideal Shape | Wide & short | Square | Extremely wide & short | | Laser Scanning | Yes (specific scanners) | No (requires camera) | Yes (all lasers & cameras) | | Error Correction | Built-in (levels 0-8) | Built-in (levels L, M, Q, H) | None (parity check only) | | Best For | Shipping, IDs, legacy hardware | Mobile apps, URLs, square layouts | Serial numbers, retail assets |
Code 128: The 1D Standard for Simple Data
Code 128 is a high-density linear (1D) barcode. It only encodes a single row of bars.
- Best use case: Serial numbers, tracking numbers, or retail labels containing 10–30 characters.
- Limitations: If you try to encode more than 50 characters, Code 128 becomes extremely wide. This makes it very difficult to print on small labels and hard to scan.
- Scanning compatibility: Virtually 100% of scanners — including cheap laser scanners — can read Code 128.
PDF417: The Wide Stacked 2D Barcode
PDF417 is a stacked 2D barcode. Instead of a single row, it consists of multiple rows stacked on top of each other.
- Best use case: Shipping labels (FedEx/UPS), boarding passes, and identity documents where you must store a substantial amount of data (up to ~1 KB) without a network connection.
- Advantage over Code 128: It can store much more data in a fraction of the width.
- Advantage over QR: PDF417 has a wide-and-short aspect ratio that fits perfectly along the edges of rectangular shipping labels or documents. It can also be read by some specialized laser scanners that sweep vertically.
- Error Correction: Built-in Reed-Solomon error correction ensures the barcode remains readable even if a part of it is torn or smudged.
QR Code: The Square 2D Standard
QR Code is a matrix 2D barcode arranged in a square grid of dark and light modules.
- Best use case: Consumer scanning, mobile applications, URLs, and square spaces.
- Advantage: Omnidirectional scanning (scans from any angle) and ultra-fast detection. It also handles larger payloads (up to ~3 KB).
- Limitations: Requires a camera-based scanner or smartphone image sensor. Traditional laser scanners cannot read QR codes at all. Its square layout is also harder to fit on narrow/rectangular labels.
Key Decision Factors
- How much data do you have?
- Under 20 characters: Use Code 128.
- 20–1,000 characters: Use PDF417 (rectangular space) or QR Code (square space).
-
Over 1,000 characters: Use QR Code.
-
What scanners will be used?
- If you must support legacy laser scanners, use Code 128 or a PDF417 configured for rastering scanners.
-
If you are targeting smartphones or modern image scanners, use QR Code or PDF417.
-
What is the layout of your label?
- Wide, narrow space: Use PDF417 or Code 128.
- Square space: Use QR Code.
Ready to Generate?
- To generate print-ready PDF417 codes, use our Free PDF417 Generator.
- For automated workflows, check the developer-friendly PDF417 Barcode API.