Code 128 is one of the most widely used linear barcodes in the world, and for good reason. It packs a lot of data into a compact space and handles everything from shipping labels to inventory tags without breaking a sweat.
If you need to encode alphanumeric data and want a format that scanners everywhere will recognize, Code 128 is almost always the right choice.
Code 128 is a high-density, linear (1D) barcode symbology capable of encoding the full 128-character ASCII character set. Unlike some older formats that only handle uppercase letters or numbers, Code 128 can represent uppercase and lowercase letters, digits, and a range of special characters all within the same barcode.
It was introduced in 1981 and has since become a standard in logistics, manufacturing, retail, and healthcare. The format is governed by ISO/IEC 15417 and is supported by virtually every modern barcode scanner on the market.
One of its key technical features is its use of three internal subsets. Code 128A handles uppercase letters and control characters. Code 128B handles the full printable ASCII range including lowercase. Code 128C is optimized for pairs of digits, encoding two digits per symbol and making it extremely compact for numeric-only data. A single barcode can switch between subsets mid-stream, which is how the format stays efficient across varied content.
Every Code 128 barcode includes a check character calculated from the encoded data. This helps scanners catch read errors before they cause problems downstream.
Code 128 turns up in a lot of places because it handles real-world data well. Here are some of the contexts where it is most commonly used:
Code 39 was one of the first alphanumeric barcodes and is still in active use, particularly in older industrial and government systems. But when you compare the two formats side by side, Code 128 has a clear edge in most modern scenarios.
In short: if you are designing a new system or generating barcodes for shipping, healthcare, or anything that might include lowercase letters or special characters, Code 128 is the better choice. Code 39 is worth considering only when compatibility with legacy equipment is a hard requirement, since some older scanners or industrial readers may not handle Code 128 reliably. You can also generate Code 39 barcodes on this site if that format is what your system requires.
The Code 128 Barcode Generator on FJ TechTools is free and requires no account. Here is how to use it:
If you need to create a large batch of barcodes from a list of values, the Bulk Barcode Generator lets you generate multiple barcodes at once without doing them one at a time.
A Code 128 barcode has a defined physical structure. From left to right, it contains a quiet zone (a blank margin), a start character that tells the scanner which subset is active, the encoded data characters, a check character, a stop character, and another quiet zone on the right. Each character is represented by three bars and three spaces, and the barcode always terminates with a four-bar stop pattern.
The check character is calculated by taking the value of the start character, then adding the weighted sum of every data character (each multiplied by its position index), and taking the result modulo 103. This is computed automatically by any compliant generator, so you do not need to work it out manually, but understanding it helps when troubleshooting scan errors or validating barcodes programmatically.
For barcodes where the check character matters and you want to verify or understand it, the Barcode Check Digit Calculator on this site can help.
Generating a technically correct barcode is only half the job. How you print and apply it affects whether it scans reliably in the real world.
GS1-128 (previously known as UCC/EAN-128) is a specific application of the Code 128 format governed by GS1 standards. It uses a special Function 1 character at the start of the data to signal that what follows is structured GS1 data, organized with Application Identifiers (AIs) that define what each segment of data means, for example (01) for a GTIN, (17) for an expiration date, or (10) for a batch number.
If you are generating barcodes for supply chain use and your trading partner or retailer requires GS1-128 compliance, you need to follow GS1's formatting rules for the data string, not just pick Code 128 as the symbology. The barcode format itself is Code 128, but the data structure is what makes it GS1-128.
Enter any text or alphanumeric string and download a print-ready barcode in seconds, no account required.
Open Code 128 Generator