Free, in your browser, no upload
Code 128 barcode generator for labels and inventory
Code 128 holds any keyboard character and packs long runs of digits two to a symbol, so it stays compact. We pick the code sets for you, add the check character and size the bars to your label printer.
- Letters, digits and symbols
- Code sets chosen for you
- Sized for 203 and 300 DPI printers
Letters, digits, spaces and punctuation. Long runs of digits are packed two to a symbol.
More QR and barcode tools
How to make a Code 128 barcode
Type the text
A SKU, serial number, order or tracking number, a shelf location: up to 80 keyboard characters.
Match your printer
Choose the printer’s DPI and a bar width that lands on whole dots, such as 0.25 mm at 203 DPI (2 dots).
Set the height
10 to 15 mm suits most handheld scanners. Taller helps when labels are scanned from a distance.
Download
The PNG at the printer’s resolution for label software, or PDF and SVG for documents.
How Code 128 stays compact
Every Code 128 character is 11 modules wide, made of three bars and three spaces. The standard has three character sets, and a code can switch between them mid-way. A start character picks the first set, a check character worked out with modulo 103 follows the data, and a stop pattern of 13 modules ends it.
| Set | Holds | Best for |
|---|---|---|
| A | Capital letters, digits, punctuation and control codes | Legacy systems that use control characters |
| B | Capital and lower case letters, digits and punctuation | Most text, such as SKU-2026-0042 |
| C | Pairs of digits, 00 to 99, in one character | Long numbers: twice as dense as set B |
We use set C for runs of four or more digits and set B for the rest, which keeps barcodes short without you thinking about it.
How wide your barcode will be
Digits pack tightly, letters do not. Measured with our encoder, including the 10 module quiet zones:
| Content | Modules | Width at X 0.25 mm | Width at X 0.33 mm |
|---|---|---|---|
| 1234567890 | 110 | 27.5 mm | 36.3 mm |
| 00012345678905 | 132 | 33.0 mm | 43.6 mm |
| ABCDEFGHIJ | 165 | 41.3 mm | 54.5 mm |
| SKU-2026-0042 | 187 | 46.8 mm | 61.7 mm |
| Order 55321 / Box 2 | 264 | 66.0 mm | 87.1 mm |
For comparison, 1234567890 in Code 39 takes 211 modules, almost twice the width, because Code 39 has no compact digit set.
Code 128, Code 39 or GS1-128?
They are often confused. The differences that matter:
- Code 128 takes any keyboard character and is compact. Its check character is required and added for you.
- Code 39 takes only capitals, digits and a few symbols, and is wider, but older scanners and systems that expect it still need it. Our generator makes both.
- GS1-128 is Code 128 with a special start (FNC1) and GS1 data fields such as (01) for a GTIN or (17) for an expiry date, used on logistics labels. We make plain Code 128; if your customer asks for GS1-128 or an SSCC label, use software that supports GS1 Application Identifiers.
Printer settings for crisp bars
Bars must be a whole number of printer dots, or some come out thicker than others. Good bar widths for common printers:
| Printer | One dot | Good bar widths (X) |
|---|---|---|
| 203 DPI thermal | 0.125 mm | 0.25 mm (2 dots), 0.375 mm (3 dots) |
| 300 DPI thermal or laser | 0.085 mm | 0.254 mm (3 dots), 0.339 mm (4 dots) |
| 600 DPI laser | 0.042 mm | 0.254 mm (6 dots), 0.339 mm (8 dots) |
The PNG download rounds X to whole dots at the DPI you choose and states the result. PDF and SVG are vectors, so your print software does the rounding.
Questions
What characters can Code 128 hold?
All 128 ASCII characters. This generator takes the printable ones: letters, digits, spaces and punctuation, which covers labels and IDs.
Does Code 128 need a check digit?
Yes, one check character calculated with modulo 103. We add it automatically. Scanners check it and do not show it.
Is Code 128 the same as GS1-128?
GS1-128 is a use of Code 128 with an FNC1 start and GS1 data fields. Plain Code 128, which this tool makes, is right for your own internal codes.
How long can a Code 128 barcode be?
The standard sets no fixed limit, but scanners must see the whole width. We cap it at 80 characters; for more, a Data Matrix or PDF417 is far smaller.
Can I use a Code 128 font in Excel instead?
A font alone is not enough: the text must be converted to start, check and stop characters first. It is simpler to make the image here, or a batch of QR codes with our bulk generator.
What size should a Code 128 barcode be?
We suggest a bar width of 0.25 to 0.5 mm and a height of 10 to 15 mm, taller for long codes so the scanner line can cross it at a slight angle. Keep 10 modules of blank space at each end.
Can phones scan Code 128?
Yes. Most barcode scanner apps read it, and so does our scanner for images.