What Is Code 128
Code 128 is a high-density barcode format that efficiently encodes alphanumeric data in a compact space. It is the modern standard for most retail and POS applications.
Key Characteristics of Code 128
High-Density Format
Code 128 can encode more characters per inch than Code 39, making it ideal for longer numbers on smaller cards. A 16-digit number in Code 128 occupies significantly less space than the same number in Code 39.
Supports Numeric and Alphanumeric Data
Code 128 can encode the complete ASCII character set, including uppercase letters, lowercase letters, numbers, and special characters. This flexibility makes it suitable for complex identification schemes.
Example: Code 128 can encode "ABC123xyz" or "6006000000001234" with equal efficiency.
Allows Longer Numbers in Smaller Space
This space efficiency is particularly valuable on small gift cards or key tags where print area is limited. A barcode that would require 3 inches in Code 39 might only need 1.5 inches in Code 128.
Commonly Used by Modern POS Systems
Most POS systems installed in the last 10-15 years default to Code 128 for gift cards and loyalty programs. Square, Clover, Toast, Shopify POS, and other contemporary platforms all support Code 128 natively.
Technical Specifications
Character Set
Full ASCII (128 characters including all alphanumeric)
Bar Width
Variable width with 4 different bar widths
Data Density
High density (approximately 5.5 characters per inch)
Check Digit
Mandatory modulo 103 check digit for error detection
Quiet Zone
10X minimum (10 times the width of narrowest bar)
Year Introduced
1981 (designed for modern scanning equipment)
Industry Standards
Both Code 128 and Code 39 are standardized barcode formats maintained by international standards organizations, ensuring reliability and scanner compatibility worldwide.
What Is Code 39
Code 39 is an older barcode format that uses a simpler encoding scheme but requires more physical space to represent the same data. It remains in use primarily with legacy systems.
Key Characteristics of Code 39
Older Barcode Format
Code 39 was developed in 1974, making it one of the earliest alphanumeric barcode formats. While proven and reliable, it was designed for technology and scanning capabilities that are now decades old.
Lower Data Density
Code 39 uses a less efficient encoding method where each character requires more bars and spaces. This results in barcodes that are approximately 2-3 times longer than equivalent Code 128 barcodes.
Impact: A 13-digit number that fits in 1.5 inches with Code 128 may require 3-4 inches with Code 39.
Larger Printed Size Required
The low density means Code 39 barcodes require significantly more physical space. On small gift cards or key tags, this can be problematic or even impossible to accommodate while maintaining scannability.
Still Used by Some Legacy Systems
Older POS systems, particularly those installed before 2000, may be configured exclusively for Code 39. Some industrial and government applications also standardized on Code 39 decades ago and continue using it for consistency.
Technical Specifications
Character Set
43 characters (0-9, A-Z, space, and 7 special characters)
Bar Width
Two widths (narrow and wide) in 3:1 ratio
Data Density
Low density (approximately 2 characters per inch)
Check Digit
Optional modulo 43 check digit (not always used)
Quiet Zone
10X minimum (same as Code 128)
Year Introduced
1974 (designed for early laser scanners)
Visual and Technical Differences
The differences between Code 128 and Code 39 become immediately apparent when comparing physical barcodes side by side.
Side-by-Side Comparison
Barcode Length for Same Data
Code 128 (13 digits)
Approximate Length: 1.5 inches
6006000001234
Code 39 (13 digits)
Approximate Length: 3.5 inches
6006000001234
Key Observation: Code 39 requires more than twice the horizontal space to encode the same data. This makes Code 128 the clear choice for small cards or tags.
Character Density Comparison
Code 128
Code 39
Required Quiet Zones
Both Code 128 and Code 39 require quiet zones (blank space before and after the barcode) to scan reliably. The minimum is 10X, meaning 10 times the width of the narrowest bar.
Practical Impact:
Code 128: Narrower bars mean smaller required quiet zones in absolute terms
Code 39: Wider bars mean larger absolute quiet zone requirements
Both formats need adequate quiet zones, but Code 128's smaller overall footprint makes it easier to accommodate on small cards.
Print Size Implications
The size difference has direct implications for card design and layout.
Standard Gift Card (3.375" × 2.125")
Code 128:
Fits comfortably with room for design elements
Code 39:
May dominate entire card face or require smaller print size
Small Key Tag (1.5" × 3")
Code 128:
Easily accommodates most number lengths
Code 39:
May not fit longer numbers at scannable sizes
Scanner Compatibility Differences
Barcode scanners must be configured to recognize specific barcode formats. Compatibility is not universal or automatic.
Most Scanners Support Code 128 by Default
Modern barcode scanners manufactured in the last 15 years typically enable Code 128 scanning out of the box. This reflects Code 128's status as the current industry standard.
Common Scenarios:
Retail scanners from Zebra, Honeywell, Datalogic: Code 128 enabled by default
Smartphone-based scanners: Native Code 128 support in scanning SDKs
POS-integrated scanners from Square, Clover, etc.: Code 128 is primary format
Some Scanners Require Configuration for Code 39
Many scanners ship with Code 39 disabled to prevent accidental reads of Code 39 barcodes in retail environments where they may appear on product packaging but are not intended for POS scanning.
Configuration Required:
Step 1: Locate scanner configuration manual or programming guide
Step 2: Find Code 39 enable/disable barcode in manual
Step 3: Scan the "Enable Code 39" configuration barcode
Step 4: Test with actual Code 39 barcode to verify
This configuration step is often overlooked, leading to "barcode won't scan" issues when businesses switch to Code 39.
Older Scanners May Struggle with Dense Code 128 Barcodes
Some barcode scanners manufactured before 2005 may have difficulty reading very high-density Code 128 barcodes, especially if printed at small sizes or if the scanner optics are designed for wider bar codes.
Potential Issues:
Low Optical Resolution: Scanner cannot distinguish closely-spaced bars
Slow Decode Speed: Scanner takes multiple seconds to read dense barcodes
Intermittent Failures: Scanner reads successfully sometimes but not others
Solution: If using scanners more than 15 years old, test with sample barcodes before full production. You may need to use Code 39 or upgrade scanning hardware.
Always Test Before Production
The only way to guarantee compatibility is testing with your actual scanning hardware. We recommend obtaining sample barcodes in both formats and testing with all scanners used at your locations.
Learn about scanner compatibility testingPOS System Compatibility
POS systems handle barcode formats at the software level, independent of scanner hardware. System configuration determines which formats are recognized and processed correctly.
POS Systems May Require Specific Barcode Formats
Many POS systems are configured to expect gift cards in a specific barcode format. The format specification is often set during initial system configuration and may not be easily changed.
How POS Systems Identify Gift Cards
When a barcode is scanned, the POS system must determine what type of item was scanned (product, gift card, coupon, etc.). This identification process relies on multiple factors:
Number Prefix
System checks if scanned number starts with designated gift card prefix (e.g., "6006")
Number Length
System verifies scanned number has correct length for gift cards (e.g., 16 digits)
Barcode Format
System may expect data encoded in specific format (Code 128 or Code 39)
Why Choosing the Wrong Format Causes Scanning Failures
If your POS system expects Code 128 but you print Code 39, several failure modes can occur:
Scanner Reads, POS Rejects
Scanner successfully reads Code 39 barcode and sends data to POS, but POS software rejects it because format doesn't match configuration. Card appears to scan but system displays error.
Wrong Data Interpretation
POS interprets barcode data differently than intended because Code 128 and Code 39 encode characters differently. This can cause number corruption or misreads.
Scanner Disabled for Wrong Format
Some POS configurations disable scanning for formats other than the expected one, so wrong-format barcodes produce no response at all.
Configuration Matters More Than Brand Name
You cannot assume barcode format requirements based solely on POS brand. Two businesses using the same POS platform may have different format requirements based on how each system was configured.
Example Scenario:
Business A: Square POS configured with Code 128 gift cards in 2023
Uses 16-digit numbers, Code 128 format, requires activation at sale
Business B: Square POS migrated from legacy system in 2018
Uses 13-digit numbers, Code 39 format (retained from old system), pre-activated cards
Result: Same POS brand, completely different barcode requirements. This is why testing your specific configuration is essential.
Which Barcode Format Is Better for Gift Cards
For gift card applications, Code 128 is generally the superior choice due to its efficiency and compatibility with modern POS systems.
Why Code 128 Is Commonly Preferred
Smaller Card Footprint
Gift cards are typically 3.375" × 2.125" (credit card size). Code 128 barcodes fit comfortably while leaving room for branding, terms, and design elements. Code 39 barcodes often dominate the entire card face.
Longer Number Support
Modern gift card systems often use 16 or 19-digit numbers for improved security and larger number pools. Code 128 can encode these longer numbers at scannable sizes, while Code 39 struggles.
Modern POS Compatibility
All major contemporary POS platforms (Square, Clover, Toast, Shopify POS, Lightspeed, Revel, etc.) default to Code 128 for gift card functionality. This reflects industry standardization on the format.
Built-In Error Detection
Code 128's mandatory check digit provides reliable error detection. If a barcode is damaged or misread, the system detects the error rather than processing incorrect data.
When Code 39 May Still Be Required
Despite Code 128's advantages, some scenarios necessitate Code 39:
Legacy POS Systems
POS systems installed before 2000 may be configured exclusively for Code 39 and cannot be reconfigured without significant cost or system replacement.
Existing Card Inventory
Businesses with existing Code 39 cards in circulation may need new cards to match the same format for system consistency.
Specific Industry Requirements
Some specialized industries or government applications standardized on Code 39 decades ago and maintain that standard for compatibility across multiple systems.
POS Balance Tracking Considerations
The barcode format itself does not affect balance tracking functionality. Both Code 128 and Code 39 encode the same card number, which is what the POS uses to look up and update balances.
Important: Choose the format your POS requires, not based on assumptions about balance tracking. Both formats work equally well for balance management when properly configured.
Which Barcode Format Is Better for Key Tags
Key tag applications have unique physical and operational considerations that influence format selection.
Membership and Loyalty Systems
Membership systems generally offer more flexibility in barcode format choice compared to gift card systems, since they identify accounts rather than store value.
Code 128 Advantages
Fits smaller key tag sizes easily
Supports longer member ID numbers
Better for high-volume check-ins
Modern system compatibility
Code 39 Use Cases
Legacy membership systems
Existing tag inventory matching
Larger tag sizes with room for Code 39
Short member ID numbers (under 10 digits)
Scan Distance and Tag Size Constraints
Key tags are scanned from varying distances and angles, often by the member themselves. This creates unique scanning requirements.
Small Tags (1.5" × 3" or smaller)
Code 128 is strongly preferred for small key tags. A Code 39 barcode may not physically fit at a scannable size, or may consume the entire tag surface leaving no room for branding.
Recommendation: Use Code 128 unless your system specifically requires Code 39 and you can accommodate larger tags.
Medium Tags (2" × 3.5" or similar)
Both formats work on medium-sized tags. Choose based on system requirements rather than size constraints.
Recommendation: Default to Code 128 for consistency with modern systems unless Code 39 is specifically required.
Large Tags (3" × 4" or larger)
Size is not a limiting factor. Both Code 128 and Code 39 fit comfortably with room for design elements.
Recommendation: Choose based solely on system requirements. Test both formats with actual scanners if uncertain.
Durability Considerations
Key tags experience more wear than gift cards because they are carried daily, attached to keychains, and repeatedly scanned. Barcode format affects durability indirectly.
Code 128 Durability
Narrower bars are theoretically more vulnerable to damage, but modern printing and lamination make this negligible. Built-in error detection helps identify damaged barcodes rather than misreading them.
Code 39 Durability
Wider bars may tolerate minor printing defects better, but optional check digits mean damaged barcodes might be misread rather than rejected.
Conclusion: Print quality and material choice affect durability far more than barcode format. Either format performs well when properly printed and protected.
Common Mistakes When Choosing Barcode Formats
Businesses frequently make avoidable errors when selecting barcode formats, leading to unusable cards and costly reprints.
Assuming Scanners Read All Formats
Many business owners assume that if they have a barcode scanner, it will automatically read any barcode format. This is false.
Reality:
Scanners must be configured to recognize specific formats. A scanner enabled for Code 128 may not read Code 39 without reconfiguration, and vice versa.
Solution: Test sample barcodes with your actual scanner before ordering production cards. If samples don't scan, reconfigure scanner or choose different format.
Choosing Format Based on Appearance
Some businesses choose Code 39 because they prefer the appearance of wider bars, or Code 128 because it looks "more modern." Appearance is irrelevant if the format doesn't work with your system.
Reality:
Customers and staff do not notice or care about barcode format aesthetics. They only care that cards scan quickly and reliably at checkout or check-in.
Solution: Choose format based on technical requirements, not visual preference. Functional compatibility always takes priority over aesthetics.
Ignoring POS Documentation
POS system documentation often specifies required barcode formats, but many users skip reading these specifications and guess instead.
Reality:
Your POS provider's gift card setup documentation typically states "Use Code 128" or "Use Code 39" explicitly. This specification is not a suggestion; it is a requirement.
Solution: Before ordering cards, locate your POS system's gift card documentation. Look for sections titled "Barcode Requirements," "Card Setup," or "Gift Card Specifications." Follow documented requirements exactly.
Prevention Is Simple
All three of these mistakes are prevented by testing sample barcodes with your actual POS and scanner hardware before production. A five-minute test saves hundreds or thousands of dollars in reprint costs.
How Scan-Cards Helps Choose the Correct Format
We work with businesses to verify barcode format requirements before production, reducing the risk of compatibility issues and ensuring cards work correctly the first time.
Our Format Verification Process
POS Compatibility Review
We ask about your POS system, review your gift card or membership module configuration, and identify the barcode format your system requires. When documentation is unclear, we help you contact your POS provider for clarification.
Scanner Considerations
We discuss your scanning hardware to identify potential compatibility issues. If you have older scanners or specialized equipment, we recommend testing procedures to verify format support before full production.
Format Verification Before Printing
When possible, we provide test barcodes in both Code 128 and Code 39 for you to scan with your equipment before we begin production. This confirmation step eliminates format guesswork and ensures cards will work on arrival.
Our Goal: Cards That Work on Arrival
We do not want you to receive cards that do not scan correctly. Taking time to verify format requirements before printing prevents costly mistakes and ensures your cards work perfectly with your system from day one.