Skip to content

Free Code 128 Barcode Generator

Turn any ASCII text into a Code 128 barcode: order numbers, serials, SKUs, tracking codes. The generator picks between code sets A, B and C on its own to keep the symbol as short as possible, shows a live SVG preview and exports PNG, SVG or vector PDF.

Letters, digits and ASCII symbols. Code sets A, B and C are chosen automatically.

Valid

Customize
#000000
#ffffff

Generating…

Your data stays on your device.

How does it work?

  1. 1Type or paste your text: letters, digits and common symbols (ASCII).
  2. 2Watch the live preview and the valid/invalid indicator; an error message explains any character that cannot be encoded.
  3. 3Set the scale (bar width), bar height, colours and choose whether the text is printed under the bars.
  4. 4Download the barcode as PNG, SVG or a vector PDF.

What is Code 128 Barcode Generator?

Code 128 is a high-density linear barcode that can encode all 128 ASCII characters. It uses three code sets: A (upper-case letters, digits and control characters), B (upper and lower case letters, digits and punctuation) and C (pairs of digits, which packs numbers at double density). A start character selects the set, and special shift and switch characters let the symbol change set mid-way.

Every Code 128 symbol ends with a check character (a modulo 103 checksum) followed by a stop pattern. The generator adds both for you, so you only supply the data. The barcode needs a quiet zone of at least ten times the bar width on each side to scan reliably.

Code 128 is the everyday choice for shipping labels, warehouse locations, asset tags and serial numbers. GS1-128, used for pallet and logistics labels, is a strict variant of it with Application Identifiers. Characters outside ASCII, such as accented letters, cannot be encoded and are flagged as invalid.

When should you use it?

  • You need to label parcels, boxes or shelves with order numbers or location codes.
  • Your serial numbers or SKUs mix letters and digits, which rules out EAN and UPC.
  • Asset tags or equipment IDs must be scanned by a handheld reader.
  • You want a compact barcode for a long run of digits: Code 128 uses set C to encode two digits per symbol.
  • You are printing internal document or ticket references for a scanning workflow.

Privacy

This tool runs in your browser. What you type, paste or open is processed on your device by JavaScript and is not sent to our servers, stored or shared. Your data stays on your device.

Your text is encoded into bars by JavaScript in your browser and is never sent anywhere. The barcode contains exactly the characters you entered plus the standard start, check and stop characters.

Frequently Asked Questions

What characters does Code 128 support?

All 128 ASCII characters: letters, digits, punctuation and control characters. Accented letters, non-Latin scripts and emoji are outside ASCII and are not accepted, so replace them with plain equivalents.

Why do long numbers give a shorter barcode?

When a run of digits has an even length the encoder switches to code set C, which stores two digits in one symbol. That is why 12345678 is noticeably narrower than a string of letters of the same length.

How wide should the bars be when I print?

For office laser printers aim for a bar width of about 0.25 mm or more and print at 100 % / actual size. Thermal label printers can handle finer bars, but always test-scan a printed sample with the reader you will actually use.

Is Code 128 the same as GS1-128?

No. GS1-128 uses the Code 128 symbology but adds a special FNC1 character and structured Application Identifiers like (01) or (10). A plain Code 128 is free-form text; use the GS1-128 tool when a trading partner asks for AIs.