FreeOnlineQR
GuidesJune 29, 2026 7 min read

Code 128 vs Code 39: Choosing the Right General-Purpose Barcode

Neither of these is a retail product barcode — they're the workhorses of internal inventory, asset tracking, and shipping labels. Here's how to pick between them.

Screenshot of the tool covered in "Code 128 vs Code 39: Choosing the Right General-Purpose Barcode"

Two workhorse formats, not a retail choice

Unlike EAN-13 or UPC-A, Code 128 and Code 39 aren't retail-mandated formats — nobody requires a specific one for a product listing. That means the choice actually comes down to what you're labeling, what's scanning it, and how much space you have, rather than a compliance requirement.

Code 128: dense and flexible

Code 128 encodes the full ASCII character set — every letter, number, and most punctuation — in a comparatively compact barcode, using three internal character sets it can switch between automatically to maximize density. This makes it the default choice across shipping and logistics (it's the base format behind GS1-128, used throughout supply chains), inventory management, and asset tagging.

Its main tradeoff is complexity: because of the internal character-set switching, Code 128 is slightly harder to decode reliably with very old or low-quality scanning hardware compared to simpler formats — though this is rarely an issue with any scanner built in the last two decades, including any smartphone camera.

Code 39: simple and universally supported

Code 39 is older, simpler, and less space-efficient — it can only encode uppercase letters, digits, and a small set of symbols (- . space $ / + %), and takes noticeably more horizontal space to encode the same text as Code 128. Its virtue is simplicity: it doesn't require a check digit, decodes reliably even on decades-old laser scanners, and remains extremely widely supported in legacy industrial and inventory systems.

Side-by-side comparison

Character support: Code 128 supports the full ASCII set; Code 39 is limited to uppercase letters, digits, and a handful of symbols.

Density: Code 128 is significantly more space-efficient for the same data — often 30-50% narrower for equivalent text.

Compatibility: Code 39 has a slight edge with very old or basic scanning hardware; Code 128 is universally supported by anything made in the last 20+ years.

Complexity: Code 39 is simpler to implement and verify by eye; Code 128's variable character-set switching makes it marginally harder to troubleshoot manually, though this rarely matters in practice.

When to use Code 128

Shipping and logistics labels, general inventory and warehouse management, asset tags where you need lowercase letters or a wider symbol set, and anywhere label space is at a premium and density matters.

When to use Code 39

Integrating with older industrial or inventory scanning hardware, situations where a check-digit-free format is preferred for simplicity, and internal systems already standardized on Code 39 where switching formats isn't worth the disruption.

What about Code 93?

Code 93 is a third option worth a brief mention — more compact than Code 39 with similar character support, but less universally supported than Code 128. Unless you have a specific existing system that requires it, Code 128 covers the same ground with broader compatibility.

Real-world example: labeling a mixed warehouse

Consider a warehouse holding both purchased retail goods (already carrying manufacturer EAN-13/UPC-A barcodes) and internally fabricated or repackaged items with no existing barcode. A practical approach: use the existing manufacturer barcode for purchased goods wherever it's already present and scannable, and apply your own Code 128 labels only to items that don't already have one — rather than relabeling everything under one internal scheme, which creates unnecessary duplicate work and risks losing the traceability back to the original manufacturer lot.

Barcode length limits worth knowing

Code 128 comfortably handles up to around 80 characters in practice, though physical label space is usually the real limiting factor long before you approach that theoretical maximum. Code 39 is more constrained, both by its narrower character set and by its lower density meaning a long string takes up considerably more physical width — for anything beyond a short ID or code, Code 128 is the more practical choice purely on space grounds.

A closer look at how Code 128 achieves its density

Code 128's efficiency comes from three internal character subsets (A, B, and C) that a compliant encoder switches between automatically depending on what's being encoded — subset C, for instance, packs pairs of digits into a single symbol, which is why an all-numeric Code 128 barcode is especially compact compared to the same digits encoded in Code 39. You don't need to manage this switching manually; any standard Code 128 generator handles it internally and produces a barcode compliant with how scanners expect to decode it.

Migrating from Code 39 to Code 128

If you're currently using Code 39 for internal inventory and considering a move to Code 128, the main practical consideration is your existing scanning hardware and software — confirm your scanners and inventory system already support Code 128 (nearly all equipment from the last two decades does) before switching your labeling scheme, since running a mixed system with both formats during a transition period requires your software to correctly distinguish and parse each incoming scan type.

Both formats are reasonably forgiving of ordinary label printing, but Code 128's denser encoding means its individual bars are proportionally thinner than Code 39's for equivalent data — which makes Code 128 slightly more sensitive to print resolution and ink bleed at small sizes. If you're printing very small Code 128 labels on a lower-resolution thermal printer, test a sample scan before a full batch; Code 39's wider bars have a bit more built-in tolerance in exactly this scenario.

How these formats handle a check digit differently

Code 39 doesn't require a check digit at all in its base form, though an optional Modulo 43 check digit exists for applications wanting extra error detection, primarily used in certain government and defense specifications. Code 128 includes a mandatory check digit (calculated automatically by any compliant generator) as a core part of the symbology itself, providing a built-in layer of scan-accuracy verification that Code 39 leaves optional. Neither difference should factor heavily into your choice — both are reliable in practice — but it's worth knowing if a specification or legacy system references check-digit requirements explicitly.

A note on barcode scanner configuration

Most modern barcode scanners auto-detect which symbology they're reading without any configuration — but older or more basic dedicated scanners sometimes need specific symbologies enabled in their settings before they'll recognize a given format at all. If a Code 128 barcode isn't scanning on older hardware that previously only handled Code 39, checking the scanner's enabled-symbology settings (usually accessible via a configuration barcode or software utility from the manufacturer) is worth doing before assuming the barcode itself is the problem.

Frequently asked questions

Can Code 128 and Code 39 barcodes coexist in the same inventory system? Yes, as long as your scanning software can identify and correctly parse both formats — many inventory platforms handle this natively, decoding whichever symbology is presented without needing to be told in advance which one to expect.

Which format do most off-the-shelf label printers support?

Both are standard options in essentially every barcode label printer and labeling software on the market — this isn't typically a limiting factor in the decision either way.

Is Code 128 harder to read by eye if the scanner fails?

Both formats print the underlying data as human-readable text beneath the barcode by default, so a scan failure doesn't leave you unable to identify an item manually — this is a labeling best practice regardless of which symbology you choose.

Extended Code 39 and other variants worth knowing about

"Full ASCII" or "Extended" Code 39 is a variant that encodes lowercase letters and additional symbols beyond the base Code 39 character set, achieved by combining pairs of standard Code 39 characters — useful if you need a slightly richer character set without moving to Code 128 entirely, though it comes at the cost of even lower density than standard Code 39, since each extended character now takes two symbol positions instead of one. In practice, if you find yourself needing Extended Code 39's capabilities, Code 128 is almost always the more efficient choice instead.

How label size interacts with format choice

On a very small label (a jewelry tag or a small component), Code 39's lower density can actually become a real constraint, since encoding even a modest ID string may require more physical width than the label has available — this is a case where Code 128's compactness isn't just a nice-to-have but a practical necessity. Measure your actual label dimensions and estimate encoded-string length before finalizing a format choice for unusually small labels.

A quick summary before you generate anything

Code 128 for most new inventory, shipping labels, and asset tags where density and full-character support matter; Code 39 where legacy scanner compatibility or check-digit-free simplicity is specifically required; Code 93 only where an existing system already specifies it. None of these are retail-mandated formats, so the choice is genuinely yours to make based on your own scanning hardware and label space.

One last practical tip: labeling consistency across a team

If more than one person will be generating labels for your operation, document your chosen format and any settings (color, size, error tolerance where applicable) somewhere the whole team can reference — inconsistent settings across different team members' generated labels are a subtle, easily avoidable source of scanning reliability problems that only show up once labels from different sources start mixing on the same shelves.

Do these formats need different lighting or scanning angles?

Both Code 128 and Code 39 are read by sweeping or imaging across the bar pattern's width, so unlike a QR code's any-angle scanning, a linear barcode does need reasonably consistent orientation relative to the scanner — most modern omnidirectional scanners handle a range of rotation automatically, but severe angles or very oblique presentation can still cause an occasional failed read on either format equally.

Barcode density and why it isn't just about aesthetics

"Density" in barcode terms refers to how much data fits per unit of physical width — a genuinely practical concern, not just a technical curiosity, since it directly determines how much label real estate a given piece of information will need. A warehouse label with limited space for the barcode itself, surrounded by required text, dates, and other printed information, often has real constraints on how wide a barcode can be — which is exactly the scenario where Code 128's higher density over Code 39 becomes a practical necessity rather than a marginal preference.

Migrating an entire system without disrupting daily operations

If you're switching an established Code 39 system to Code 128 rather than starting fresh, a phased rollout — relabeling items as they naturally cycle through receiving, restocking, or routine handling, rather than a single disruptive mass relabeling event — is generally more practical for an active business. During the transition, configure your scanning software (or verify it already does this) to recognize both formats simultaneously, since a mixed inventory with both label types in circulation is a normal, manageable state during a gradual migration rather than something to avoid entirely.

Barcode readability testing across your actual scanner fleet

If your operation uses several different scanner models (a mix of handheld units, fixed mount scanners, and phone-based scanning apps, for instance), test a new barcode format across all of them before committing to a switch — individual scanner models occasionally have quirks or firmware limitations around specific symbologies that a single test on one device wouldn't reveal, and discovering this after relabeling thousands of items is a far more expensive lesson than a quick multi-device test upfront.

Getting started

For most new inventory, asset-tagging, or shipping-label projects, Code 128 is the safer modern default. Enter your text or ID above, customize colors if needed, and download as PNG, SVG, or PDF — free, with no sign-up required.

TaggedBarcodes
FreeOnlineQRWritten by the team that builds the tools in this guide.

Comments (0)

No comments yet — be the first.

Leave a comment

Comments are reviewed before they appear.

Ready to make one of your own?

Free, no sign-up, and it works in your browser.

Try the Code 128 Generator