Code 128 vs Code 39: Which Barcode Should You Use?
Published on June 28, 2026 · 5 min read

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.
The Grandfather of Barcodes: Understanding Code 39
Created in 1974, Code 39 is the reliable old workhorse of the logistics world. It was the very first barcode designed to encode both numbers and letters (alphanumeric data), which made it an instant global standard for inventory management.
What it can encode:
Code 39 is relatively limited. It can encode 43 specific characters:
- Uppercase letters (A-Z)
- Numbers (0-9)
- A handful of special characters (-, ., $, /, +, %, and space)
The major flaw: Data Density
Code 39 has very low data density. What does this mean in plain English? It means it requires a lot of physical space to print a very small amount of data.
Every single character you type into a Code 39 generator requires a significant amount of black bars and white spaces. If you need to encode a long serial number—say, 15 characters—your physical barcode label is going to be incredibly wide. If you are trying to label a small electronic component or a tiny vial in a lab, a Code 39 barcode physically will not fit on the object.
Where it is still used today:
Despite its limitations, Code 39 refuses to die. It is still heavily used in the automotive industry (specifically the AIAG standard) and the United States Department of Defense (LOGMARS). Because it is so old, absolutely every barcode scanner ever manufactured can read it natively without any configuration.
The Modern Powerhouse: Understanding Code 128
Introduced in 1981 to solve the space problems of Code 39, Code 128 is the undisputed champion of modern supply chains. If you receive a package from Amazon or FedEx today, there is a Code 128 barcode on that shipping label.
What it can encode:
The "128" in its name refers to its ability to encode the entire 128-character ASCII set. This means it can handle:
- Uppercase AND lowercase letters
- Numbers (0-9)
- All punctuation and special characters
- Keyboard control characters (like Tab or Enter)
The major advantage: High Data Density
Code 128 is brilliant because it compresses data. It uses three different internal character sets (A, B, and C) and can automatically switch between them mid-barcode to find the most mathematically efficient way to display the data.
Because of this compression, a Code 128 barcode is significantly shorter in width than a Code 39 barcode containing the exact same information. It is incredibly compact, allowing you to label much smaller items while holding far more data.
The Head-to-Head Comparison
Let us look at a practical, real-world scenario. Imagine you run a medical clinic and need to label patient blood samples with a 12-digit alphanumeric code: PATIENT-4598.
If you use Code 39:
- The scanner will read it perfectly.
- However, the printed barcode will likely be over two inches wide. You will struggle to wrap it around a standard test tube without the lines curving so much that the scanner fails to read it.
If you use Code 128:
- The scanner will read it perfectly.
- The printed barcode will be roughly half the size of the Code 39 version. It will easily fit on the test tube, flat and readable.
Which One Should You Choose?
Unless you are explicitly mandated by a vendor or a government contract to use Code 39, you should almost always choose Code 128.
Code 128 is vastly superior for modern business applications. It is more compact, supports a much wider range of characters, and includes a mandatory "checksum" digit built into its architecture, making it highly resistant to scanner read-errors.
Choose Code 128 for:
- General inventory management
- Shipping and logistics labels
- Asset tracking tags
- Small product labeling
- Employee ID cards
Choose Code 39 ONLY for:
- Legacy systems that physically cannot read newer formats (very rare).
- Government or military contracts that specifically require the LOGMARS standard.
- Automotive manufacturing compliance.
Generating Your Barcodes
When you are ready to create your labels, you do not need to buy expensive proprietary software. You can generate both formats instantly on QRinsec.
-
Select either the Code 128 or Code 39 tool.
-
Type in your data (remember, Code 39 will not accept lowercase letters).
-
The system will automatically calculate the necessary check digits and generate the scannable image.
-
Download the image as a PNG for printing on standard label makers, or an SVG if you are sending it to a commercial printing press.
Frequently Asked Questions (FAQ)
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.
Simplify Your Logistics
Do not let legacy formats dictate your modern warehouse. If you are building a new system from scratch, standardizing on Code 128 will save you physical label space, reduce scanning errors, and allow you to encode complex data effortlessly. Head to the QRinsec barcode generator, input your inventory data, and start printing high-density labels today.
Create your QR code for free
No sign up, no limits — generate and download in seconds.
Open the generator

