Introduction
When encoding data into a barcode or QR code, there are limits to how much information can be stored. These limits vary by barcode format, but in practice the reliability of scanning is usually a more important constraint than the technical maximum.
Barcode capacity by format
Format | Theoretical Maximum | Recommended | Best for |
QR Code | ~3,000 characters (alphanumeric) | Under 300 characters for general use. Under 150 characters for best performance | URLs, tokens, and general-purpose use |
PDF417 | ~1,800 characters | under 800β1,000 characters | structured dara (e.g. boarding passes, IDs) |
Aztec | ~3,000 characters | under 500β1,000 characters | Transport and ticketing use cases |
Code 128 (linear barcode) | ~80β100 characters | under 50 characters | 1-D Barcode scanners |
Why shorter is better
Even if a barcode format supports large amounts of data, longer values create denser barcodes, which are harder to scan.
Scanning reliability depends on:
Scanner quality (especially older POS hardware)
Screen brightness and glare
Scan angle and distance
Barcode size on the device
Best practice
For most PassKit implementations:
Use QR codes for anything beyond very short values
Keep barcode payloads as short as possible
Use a unique identifier or secure token rather than embedding full data
Resolve data via your backend system
Summary
While modern barcode formats can store large amounts of data, the most reliable approach is to keep payloads short and simple.
In most cases, a short identifier or URL under 150β300 characters will provide the best performance across devices and scanners.
