Skip to content
CentNook
Menu

Code 128 barcode generator

Type letters, numbers or both to make a compact Code 128 barcode for shipping labels, stock and asset tags. Paste a list to make a whole batch, then download them as PNG or SVG.

Make

Letters, digits, spaces and keyboard symbols, up to 80 characters.

Code 128 barcode
Code 128 barcode for SKU-48213907
SKU-48213907
Barcode type
Code 128
Encoded text
SKU-48213907
Code sets
B (4 characters), then C (8 digits)
Size
2.00 × 0.65 in (50.9 × 16.5 mm)
Bar width
13.0 mil (0.330 mm)
PNG at 300 DPI
616 × 200 px

Sizes are for the SVG, which keeps them exactly. The PNG rounds each bar to whole pixels: at 300 DPI that’s 4 px, or 0.339 mm.

Code 128 is for your own labels: shipping, stock bins, inventory and asset tags. Store checkouts scan UPC and EAN barcodes, so products sold in shops need one of those.

Size

The width of the narrowest bar. Thinner bars make a smaller barcode but need a sharper printer.

Units

Leave empty for a height that suits the length.

Added on every side. The blank quiet zone scanners need is always kept.

Colors

  • Nothing is uploaded
  • Free, no sign-up
  • Works on phone and desktop

How to make a Code 128 barcode

  1. 1

    Type the text or number: a tracking or order number, SKU, bin location or asset ID, up to 80 characters.

  2. 2

    Pick a bar width and, for a thermal label printer, its DPI (203 or 300), so every bar prints as whole dots.

  3. 3

    Check the code sets line: runs of digits are packed two to a symbol, which keeps the barcode short.

  4. 4

    Download a PNG or SVG, or switch to a batch from a list to make a ZIP of labels at once.

Features

  • Any keyboard text

    Capitals, lowercase, digits, spaces and punctuation: all 95 printable ASCII characters.

  • Automatically compact

    Switches between code sets B and C to use the fewest symbols, and adds the mod-103 check symbol.

  • Sized for label printers

    Choose 203 or 300 DPI and the bars snap to whole printer dots, so thermal labels print crisp and even.

  • Batches of up to 500

    Number a run of asset tags or bin labels from a spreadsheet column and get every barcode in one ZIP.

Where Code 128 is used

Code 128 is the everyday barcode for anything that isn't scanned at a store checkout. It holds letters and digits, it's compact, and nearly every barcode scanner reads it. Parcel carriers print tracking numbers in Code 128 or its GS1-128 variant, and it's a common choice for:

UseExample valueTip
Shipping and receivingPO-2026-004417Encode the order or tracking number, not the address.
Bin and shelf locationsA-03-12Short codes give a short barcode that's quick to scan.
Inventory SKUsSKU-48213907Keep digits together at the end so they pack into pairs.
Asset tagsIT-000417Use durable labels on equipment that gets handled.

How the tool keeps it compact

Code 128 draws letters one per symbol (code set B) and digits two per symbol (code set C), and switching between sets costs one symbol. The generator works out the cheapest mix. SKU-48213907 starts in set B for SKU-, then switches to set C for the 8 digits: 134 modules including the start, check and stop symbols, against 167 if it stayed in set B. At 10 mil, with its quiet zones, that's 1.54 inches wide, which fits a 2 × 1 inch label.

An odd number of digits can't all pair up, so one is drawn in set B: 12345 becomes the pairs 12 and 34, then a 5 on its own. Four digits in the middle of some text save nothing (the switch into set C and back costs as much as it saves), so they stay in set B.

Printing on a label printer

Thermal label printers usually print at 203 or 300 dots per inch, and each bar has to be a whole number of dots. These are the bar widths you can actually get:

PrinterNarrowest barWidthIn mils
203 DPI2 dots0.250 mm9.9 mil
203 DPI3 dots0.375 mm14.8 mil
203 DPI4 dots0.500 mm19.7 mil
300 DPI2 dots0.169 mm6.7 mil
300 DPI3 dots0.254 mm10.0 mil
300 DPI4 dots0.339 mm13.3 mil

Pick the DPI that matches your printer and the PNG's bars will line up with its dots. Print at 100% scale from your label software, not “fit to label”, which can stretch the bars by a fraction of a dot and make them uneven.

Height and quiet zones

Code 128 needs blank space of at least 10 modules on each side, which the downloads always include. Taller bars are easier to scan with a handheld scanner, so when you leave the height empty the tool makes it at least half an inch, or 15% of the barcode's length for long codes.

Labeling products for retail instead? Use the UPC barcode generator or the EAN-13 barcode generator. For Code 39 and every other type, open the barcode generator. Working out shipping costs into your prices? The markup calculator helps.

Frequently asked questions

What can a Code 128 barcode hold?

This tool takes any of the 95 printable ASCII characters: capitals and lowercase letters, digits, the space and punctuation. The full standard also covers control characters, and GS1-128 adds special function codes, which this tool doesn’t make. Accented letters and emoji aren’t supported.

Can I use Code 128 on products sold in stores?

No. Store checkouts look products up by their GTIN, which is carried in a UPC or EAN barcode. Code 128 is for your own labels: shipping, inventory, work orders and asset tags. GS1-128, a Code 128 variant with application identifiers, is used on cases and pallets in the supply chain, not at the checkout.

What is the difference between Code 128 and Code 39?

Both hold text, but Code 128 also holds lowercase and all punctuation, always includes a check symbol, and is much more compact. The number 1234567890 takes 90 modules in Code 128 but 191 in Code 39, not counting quiet zones. Use Code 39 only when a system or customer requires it.

Why is my Code 128 barcode so wide?

Every letter takes a whole symbol of 11 modules, while digits share a symbol in pairs, so text made mostly of letters is about twice as wide as the same number of digits. At 13 mil, each symbol is about 0.14 inches. Shorten the text, choose a thinner bar width, or keep digits together in even-length runs.

What are code sets A, B and C?

Code 128 has three character sets. A covers capitals, digits and control characters; B covers capitals, lowercase, digits and punctuation; C packs pairs of digits into a single symbol. Switching sets costs a symbol, so the tool works out where a switch actually saves space.

Do I need to add a check digit to Code 128?

No, it’s built in. Every Code 128 barcode ends with a mod-103 check symbol just before the stop pattern; the scanner verifies it and doesn’t pass it on. Only add your own check digit to the data if your system expects one there.

More free tools