Code 128 Barcode Generator
Encode any text, numbers, or mixed data as a scannable Code 128 barcode — free, unlimited, and rendered entirely in your browser.
What Code 128 encodes
Code 128 is a high-density, general-purpose barcode symbology that can represent the full 128-character ASCII set — every uppercase and lowercase letter, every digit, standard punctuation, and even non-printing control characters. That range is what makes it the default choice whenever a barcode needs to carry more than a simple product number: order IDs, tracking numbers, serial numbers, warehouse location codes, or any alphanumeric string your existing system already uses. If you're not sure which symbology to pick and your data isn't a retail product number, Code 128 is almost always the safe default.
Character set, subsets, and length rules
Code 128 encodes data using three interchangeable character subsets. Subset A covers uppercase letters, digits, punctuation, and ASCII control codes. Subset B covers upper- and lowercase letters, digits, and punctuation — the subset used for most human-readable labels. Subset C is numeric-only, but it packs two digits into a single symbol character instead of one, which roughly halves the length of long numeric strings. A capable encoder switches between subsets automatically, mid-barcode, to keep the result as compact as possible for whatever you type.
Length limits
There's no official maximum length written into the specification — the practical limit comes from your label size and the scanner's depth of field, not from the symbology itself. Strings longer than about 20-30 characters start to get visibly wide, so leave enough label real estate for whatever you're encoding.
Check digit
Code 128 always includes a built-in checksum — a modulo-103 check character — but you never see or manage it yourself. It's calculated automatically as part of encoding and isn't one of the digits you type. That's different from GTIN-family formats like EAN-13 or UPC-A, where the check digit is a visible digit printed under the bars.
Where Code 128 is used
Code 128 turns up anywhere a barcode needs to carry arbitrary text rather than a fixed-format retail number: shipping and logistics labels (it's the base symbology behind GS1-128), inventory and asset tags, patient wristbands, event and conference badges, library cards, and internal SKU or lot-number labels. It's rarely the format read at a retail checkout scanner, where EAN-13 and UPC-A are what's expected — use Code 128 for anything that isn't a shelf product, and a dedicated retail symbology for anything that is.
Sizing and printing guidance
Code 128's minimum quiet zone — the clear, unprinted margin on either side of the bars — is 10 times the narrow bar width, known as the x-dimension. At a common x-dimension of 0.25 mm, that works out to roughly a 2.5 mm clear margin on each side. Crowding that margin with text, a border, or another barcode is one of the most common reasons a barcode that looks fine on screen fails to scan once printed.
Printing guidance
For labels a handheld or fixed scanner will read reliably, print at 300 dpi or higher — thermal-transfer and most laser printers handle this without issue, though cheap inkjet output can blur narrow bars enough to cause misreads. Avoid scaling a barcode down below about 80% of its designed size, and keep it pure black bars on a white or light background; low-contrast combinations (light gray on white, red on white) fail scanners even when they look fine to the eye.
Frequently asked questions
What is the difference between Code 128 and Code 39?
Does Code 128 need a check digit?
What data can a Code 128 barcode hold?
How long can a Code 128 barcode be?
Is Code 128 used at retail checkout?
Keep going
Upload a CSV or Excel file and download a ZIP of barcodes — no per-row limit.
Print label sheetsAvery-ready PDFs with correct quiet zones, aligned automatically.
Barcode won't scan?Quiet zones, size, thermal DPI, contrast — causes and fixes, plus a live tester.
All barcode typesBrowse every symbology BarcodeSheets supports.