freebarcodeqr.com

Free Code 128 Barcode Generator.

The modern default for internal labels. Encodes any printable ASCII character.

Generated in your browser. Never stored.

Code 128 is the most common 1D barcode in warehouses, asset tracking, and shipping label internals. It encodes any of the 128 printable ASCII characters and switches automatically between three internal modes (A, B, C) to pack data densely.

If you don't have a specific reason to use a different symbology — and you're not selling at retail — Code 128 is almost always the right choice.

Generated by JavaScript in your browser. Nothing is uploaded; nothing is stored on our servers.

At a glance

StandardISO/IEC 15417 (2007) ISO/IEC 15417
Symbology familyLinear (1D), continuous, bidirectionally decodable
Character setAll 128 ASCII characters (0x00–0x7F) via three code sets (A/B/C)
LengthVariable; no formal upper bound (practical: ~25–30 chars in print)
Check digitModulo-103, calculated automatically; encoder adds, scanner validates
Module width (X)Minimum 0.250 mm for general retail; 0.150 mm for high-resolution applications
Year introduced1981 (Computer Identics Corp.); ISO standardized 1999
Code 128 is a high-density, linear symbology that encodes text, numbers, numerous functions, and the entire 128 ASCII character set (from ASCII 0 to ASCII 128).
ISO/IEC 15417:2007, scope

When to choose Code 128

Pick Code 128 when you need to encode mixed letters and digits, when you don't know the length up front, or when scanability at small print sizes matters. It is denser than Code 39 and almost as universally supported.

Almost every laser, CCD, and camera-based barcode scanner reads Code 128 by default. Mobile phone QR-and-barcode scanner apps also handle it.

Character set

Code 128 can encode all 128 ASCII characters from 0x00 to 0x7F, including lowercase letters, uppercase letters, digits, and punctuation. The encoder switches between Code Set A (uppercase + control), B (uppercase + lowercase + symbols), and C (pairs of digits, very dense) as needed.

For pure-digit data, the encoder uses Code Set C which fits two digits per symbol — making numeric Code 128 nearly as compact as ITF.

Check digit

Code 128 has a built-in modulo-103 check digit calculated automatically. You do not enter it yourself; the encoder adds and the scanner validates it.

If you see scan failures, the most common cause is print quality, not the check digit. Try a larger module size or higher print resolution.

Frequently asked questions

What's the maximum length?
There is no formal limit — Code 128 can encode any length string — but barcodes longer than about 25 characters become impractical to scan from print. For very long data, consider a 2D code like Data Matrix or PDF417.
Does Code 128 support lowercase letters?
Yes. The encoder uses Code Set B for strings with lowercase. Code 39 does not.
Why is my Code 128 barcode wider than my Code 39 version?
Despite being denser per-character, very short Code 128 strings can be slightly wider than short Code 39 because of the mode-switching overhead. The difference flips and Code 128 wins as the string grows past ~5 characters.

Related barcode formats

  • Code 39

    Uppercase letters, digits, and some symbols. Common in industry.

  • Code 93

    Denser successor to Code 39 with built-in check digits.

  • Data Matrix

    Compact 2D code for small parts and electronics.