Code 128 vs Code 39: Choosing the Right Logistics Barcode
QR & Barcode Standards Specialist · Last updated Jul 2, 2026
Walk into any warehouse, hospital, or retail stockroom, and you will see black-and-white vertical lines plastered on absolutely everything. To the untrained eye, every linear barcode looks exactly the same.
But underneath the scanner, they speak completely different languages.
If you are setting up an inventory system, creating employee ID badges, or labeling assets, you will inevitably be asked to choose a barcode format. The two absolute giants of the 1D (one-dimensional) barcode world are Code 39 and Code 128.
Pick the wrong one, and you might end up with labels that are physically too large to fit on your products, or a system that cannot process the specific data you need to encode.
Let us cut through the technical jargon. I am going to explain exactly how these two symbologies differ and tell you exactly which one you should be using for your specific project.
While retail environments are dominated by standardized UPC and EAN barcodes, the massive, invisible world of internal logistics, manufacturing, and supply chain management relies on entirely different symbologies. When a warehouse needs to track a pallet, a hospital needs to label patient blood samples, or a shipping company needs to route a package globally, they require a barcode format that allows for alphanumeric flexibility.
The two absolute titans of this industrial tracking space are Code 39 and Code 128. Unlike retail barcodes that only hold numeric digits, these two symbologies allow businesses to encode letters, numbers, and symbols to create highly specific, customized tracking IDs (like 'BIN-A-445-Z').
Despite serving similar functions, Code 39 and Code 128 represent two different eras of computing and design. Understanding the technical discrepancies between their encoding methods, data densities, and scanner compatibility is critical for engineering an efficient, error-free supply chain.
Ready to generate your code?
Create high-quality, professional QR codes and barcodes for your business completely free.
Create Your Free Code NowWhat is Code 39?
Developed in 1974, Code 39 was the first alphanumeric barcode symbology ever created. It is an absolute legacy workhorse. Its name is derived from its original structure: each character consists of 9 elements (5 bars and 4 spaces), and exactly 3 of those elements are wide.
Code 39 is defined by its simplicity and universal compatibility. It is supported by literally every barcode scanner on the planet, regardless of age or manufacturer. Furthermore, it possesses an incredibly low error rate due to its self-checking architecture.
By default, the standard Code 39 character set is limited to 43 characters: uppercase letters (A-Z), numbers (0-9), and a handful of special symbols (-, ., $, /, +, %, and space). It utilizes an asterisk (*) as a mandatory start and stop character, instructing the laser where the data begins and ends.
What is Code 128?
Code 128 is a newer, significantly more sophisticated symbology introduced in 1981 to solve the primary limitation of Code 39: data density. The '128' refers to its ability to encode the entire 128-character ASCII character set, giving it vastly superior flexibility.
To achieve this, Code 128 utilizes a highly complex, multi-subset architecture. It shifts dynamically between three different character sets (Subset A for capitals and control characters, Subset B for upper/lowercase and symbols, and Subset C for highly compressed numeric pairs) seamlessly within the exact same barcode.
Furthermore, Code 128 mandates the inclusion of a mathematically calculated check digit immediately preceding the stop character. This ensures an exceptionally high level of data integrity, practically eliminating the possibility of a scanner misinterpreting the printed lines.
The Density Dilemma: Size Matters
The most critical difference between the two formats is data density. Because Code 39 relies on a wide, simplistic 9-element structure for every single character, the resulting physical barcode is extremely wide.
If you attempt to encode a 15-character string using Code 39, the barcode will stretch significantly across the page. If you are labeling small electronics, test tubes, or narrow warehouse shelving, a long Code 39 barcode physically will not fit within the printable area.
Code 128 is vastly superior in this regard. Its advanced algorithms compress data exceptionally well, especially continuous strings of numbers (utilizing Subset C, which packs two numbers into a single character block). Encoding the exact same 15-character string in Code 128 will result in a physical barcode that is 30% to 50% shorter than its Code 39 counterpart.
Industry Standards and Compliance
While both are universally capable, different industries have rigidly standardized on one or the other. You must understand your sector's compliance requirements before choosing.
Code 39 remains the mandated standard within the United States Department of Defense (LOGMARS) and the automotive industry (AIAG). Because these sectors established their automated supply chains in the 1980s, the legacy hardware infrastructure demands the older Code 39 format.
Conversely, Code 128 is the backbone of modern global logistics. The GS1-128 standard (a specific variant of Code 128) is universally mandated for global shipping labels, pallet tracking (SSCC), and the medical device industry (UDI), due to its high density and robust check-digit verification.
Which Should You Choose?
If you are operating a completely closed-loop internal system and you only need to encode short alphanumeric strings (e.g., 'A12', 'BIN4'), Code 39 is a perfectly acceptable, foolproof choice.
However, if you are designing a new system from scratch today, Code 128 is the objectively superior technology. It supports lowercase letters, it compresses data tightly saving valuable label space, and its mandatory check digit ensures flawless accuracy.
Regardless of your choice, generate your internal tracking barcodes using a professional tool like QRinsec. Select your symbology, input your internal data string, and download the vector files (SVG) to ensure crisp, scannable prints for your warehouse labels.
Tips & Best Practices
- Tip 1: Use Code 128 as your default choice for new internal logistics and tracking systems.
- Tip 2: Utilize Code 128 if your data string contains lowercase letters or is longer than 10 characters.
- Tip 3: Use Code 39 only if specifically mandated by a legacy supplier, the military, or automotive sectors.
- Tip 4: Ensure your label printers have sufficient DPI (dots per inch) to clearly print high-density Code 128 bars.
- Tip 5: Always include human-readable text below the barcode in case a scanner fails in the field.
Frequently Asked Questions
Can I encode a website URL in a Code 128 barcode?
Technically, yes, because it supports all ASCII characters. However, a smartphone camera will not automatically open a browser when scanning a 1D barcode. For URLs, you must use a 2D QR Code.
Do I need a special scanner for Code 128?
No. Virtually every commercial laser or imaging scanner sold in the last 20 years supports both Code 39 and Code 128 out of the box.
Why are there asterisks (*) at the beginning and end of my Code 39 text?
The asterisk is a mandatory "start/stop" character required by the Code 39 standard. It tells the scanner exactly where the data begins and ends. When you use the QRinsec generator, you do not need to type the asterisks; the system adds them automatically to the barcode pattern.
What is Code 128 GS1?
GS1-128 is a specific, highly regulated subset of Code 128 used for global retail shipping. It uses specific application identifiers (like "01" for weight or "10" for batch number) so that different companies around the world can understand the exact meaning of the data inside the barcode.
Do I need a special scanner to read Code 128?
No. While it is more complex mathematically, virtually every standard 1D laser scanner manufactured in the last 25 years is programmed to read both Code 39 and Code 128 right out of the box.
Why does my Code 39 barcode have asterisks on the ends?
Code 39 fundamentally requires an asterisk (*) at the beginning and the end of the barcode graphic to tell the scanner where the data starts and stops. These asterisks are structural and are not transmitted in the final scanned text.
Can I use Code 128 to sell products in a grocery store?
No. While Code 128 is used for shipping the massive pallet of products to the grocery store's receiving dock, the individual consumer product sold at the cash register must use a standard UPC-A or EAN-13 barcode.
What is GS1-128?
GS1-128 is a specific, standardized implementation of the Code 128 symbology used in global shipping. It utilizes special Application Identifiers (like '00' for a pallet ID or '10' for a batch number) to organize complex data strings.