What Code 128 Is For
Code 128 suits values you choose yourself: bin locations, serial numbers, order references and internal item codes. It is compact for mixed text and very compact for long runs of digits. It does not replace the retail UPC.
How to Use the Code 128 Barcode Generator
Type up to 60 characters. The preview updates as you type. Download SVG for print or PNG for label software.
Code Sets A, B and C
Code 128 has three character sets. Set A covers capitals and control characters. Set B covers capitals, lowercase and symbols. Set C packs two digits into each symbol character. The tool switches between them for you.
How the Check Character Works
Each symbol character has a value. The check value is the start value plus each data value multiplied by its position, divided by 103, keeping the remainder. For BIN-A7-0042 the tool arrives at 59. The scanner repeats the sum and rejects a mismatch.
How Wide Will It Be?
Each ordinary character takes 11 modules, and a pair of digits in set C also takes 11. The preview reports the total. Long values make wide labels, so keep codes short. A Code 39 barcode of the same text is usually wider still.
GS1-128 is a related format that adds GS1 data fields. This page makes plain Code 128, not GS1-128. For other types, see the barcode maker.
Width by Value Length
These widths include the 10-module margin at each end.
| Value | Characters | Width in modules |
|---|---|---|
| A1 | 2 | 77 |
| BIN-0042 | 8 | 132 |
| 12345678 | 8 | 99 |
| PART-000123 | 11 | 154 |
| 123456789012 | 12 | 121 |
| WAREHOUSE-A-BIN-42 | 18 | 253 |
Compare the two eight-character rows. Digits alone are much shorter, because set C packs them in pairs. At a module width of 0.330 mm, 99 modules is about 33 mm and 253 modules is about 83 mm.
Designing a Good Value
- Keep only what a person or system needs to look up the item.
- Store descriptions in your database, not in the barcode.
- Use a fixed pattern, so a wrong scan is easy to spot.
- Prefer digits for long serial numbers.
- Avoid leading or trailing spaces, which are easy to miss.
Test With the Real System
Scan a sample into the program that will use it. Check that the whole value arrives, including symbols and capitals. Some scanners add an Enter key or remove characters, and that is set on the scanner, not in the barcode.
Code 128 FAQs
What can Code 128 hold?
Letters, digits and standard keyboard symbols.
Can I use it at retail checkout?
Not for the product number. Retailers expect UPC or EAN.
Is it the same as GS1-128?
No. GS1-128 uses the Code 128 bars with special markers and defined data fields.
Why is my barcode so wide?
The value is long. Shorten it, or use digits where you can.
Do I add the check character?
No. It is calculated and drawn for you.
Does case matter?
Yes. Code 128 can hold capitals and lowercase, and your system may treat them as different values.