Skip to content
ScanHatch

Code 128 Barcode Generator

Code 128 encodes any standard keyboard text in a compact barcode that virtually every scanner reads. Type your data and download the label.

Choose a barcode format

Need a QR code? Use the QR Code Generator, which adds styling and logos.

Enter the text or data to encode.

Read the Code 128 guide for data rules, common mistakes and printing advice.

Checking an existing number? Barcode Validator

Privacy: Codes are created in your browser. What you type isn't sent to ScanHatch or stored by us. Privacy policy

How to use it

  1. Type the text or number to encode. Upper and lower case letters, digits, spaces and punctuation are all allowed.
  2. Adjust the bar width and height to fit your label, keeping the quiet zone at each end.
  3. Download PNG for label software, or SVG or PDF for professional printing.

Why Code 128 is so widely used

Code 128 can encode all 128 standard ASCII characters, and it switches between three internal character sets automatically. Set C packs two digits into each symbol, so long numbers produce a noticeably shorter barcode than with Code 39. ScanHatch lets the encoder choose the most compact combination for you.

Every Code 128 barcode ends with a mod 103 check character. It's calculated automatically and checked by the scanner, but it isn't part of the data the scanner returns, so you'll never see it in the text.

Common uses

  • Warehouse, inventory and bin-location labels.
  • Asset tags and equipment IDs.
  • Shipping and courier labels (often using GS1-128, a structured variant of Code 128).
  • Library, ticketing and internal document tracking.

What Code 128 isn't for

Products sold in shops need EAN-13 or UPC-A with a registered GTIN. ScanHatch also doesn't generate GS1-128 (the version with Application Identifiers like (01) and (17) used in supply chains), which needs special FNC1 characters.

Characters outside standard ASCII, such as accented letters, aren't supported reliably by scanners and are rejected by the generator.

Size and scanning

  • Leave at least 10 bar widths of blank space at each end.
  • Make the bars at least 15% as tall as the barcode is long, and no shorter than about 6 mm, for handheld scanners.
  • Long text makes a long barcode. Beyond about 20 to 30 characters, consider a 2D code such as Data Matrix.

Frequently asked questions

Do I need to choose Code 128 A, B or C?

No. ScanHatch's encoder switches between the subsets automatically to make the shortest barcode.

Can Code 128 contain lowercase letters?

Yes, unlike Code 39. Upper and lower case letters, digits and punctuation are all supported.

Is this GS1-128?

No. This is standard Code 128. GS1-128 adds Application Identifiers and special characters, which ScanHatch doesn't generate.

Related formats

Further reading

Need another format? The full Barcode Generator supports 15 barcode and 2D code types.