Esc
↑ ↓ to moveEnter to openEsc to close

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, 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

  1. Type the text

    A SKU, serial number, order or tracking number, a shelf location: up to 80 keyboard characters.

  2. 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).

  3. Set the height

    10 to 15 mm suits most handheld scanners. Taller helps when labels are scanned from a distance.

  4. 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.

Code 128 character sets
SetHoldsBest for
ACapital letters, digits, punctuation and control codesLegacy systems that use control characters
BCapital and lower case letters, digits and punctuationMost text, such as SKU-2026-0042
CPairs of digits, 00 to 99, in one characterLong 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:

Code 128 widths for sample content
ContentModulesWidth at X 0.25 mmWidth at X 0.33 mm
123456789011027.5 mm36.3 mm
0001234567890513233.0 mm43.6 mm
ABCDEFGHIJ16541.3 mm54.5 mm
SKU-2026-004218746.8 mm61.7 mm
Order 55321 / Box 226466.0 mm87.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:

Bar widths that land on whole printer dots
PrinterOne dotGood bar widths (X)
203 DPI thermal0.125 mm0.25 mm (2 dots), 0.375 mm (3 dots)
300 DPI thermal or laser0.085 mm0.254 mm (3 dots), 0.339 mm (4 dots)
600 DPI laser0.042 mm0.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.

See all tools