FREE TOOL

Code 128 barcode generator

Type any text, a PO, a bin or a part number, and this generator makes the shortest Code 128 barcode for it, switching to the compact numeric code set wherever digits run together. Choose GS1-128 to encode GS1 data such as (01) GTIN, (10) lot and (17) expiry with the FNC1 characters scanners need. Download SVG, PNG or PDF at the size you set.

Updated October 12, 2026

Barcode generator
Tool
What to encode
Sample shown: type your own. Letters, digits, spaces and keyboard symbols. Runs of digits are packed two per bar pattern.
Size
Units
PNG downloads at 300 dpi.
Narrow bar width: 13.0 mil. Target 0.33 mm
Target 15.00 mm
Code 128 Barcode Generator, Including GS1-128 | MorsaPO-55871
Encodes PO-55871Size 43.56 mm x 18.50 mm with quiet zonesX 0.330 mm

Free for commercial use. No watermark, no sign-up.

Print at 100% or Actual size. Check the first print with the scanner that will read it before you print a run.

Runs in your browser. Nothing you type is uploaded. Your last settings are remembered in this browser.

Why warehouses use Code 128

Code 128 encodes all the characters on a keyboard and packs digits two to a symbol character, so it is far narrower than Code 39 for the same data (ISO/IEC 15417). It carries a mandatory check character inside the symbol.

Same dataCode 128 widthCode 39 width
PO-5587143.56 mm59.07 mm
BIN-A01-0354.45 mm69.63 mm

Width including quiet zones at X = 0.33 mm, Code 39 at a 3:1 ratio, as drawn by this generator.

Code 128 or GS1-128?

GS1-128 is Code 128 with an FNC1 character straight after the start, which tells the scanner the data follows GS1 rules (General Specifications 5.4.3.4.2). Use GS1-128 when a customer or the GS1 standard asks for Application Identifiers, for example on a case or pallet label. Use plain Code 128 for everything internal.

Writing GS1 data

Put each Application Identifier in parentheses, followed by its data: (01)10614141123459(10)LOT42(17)271231. The parentheses are not encoded; they appear only in the text under the bars (4.14). The generator:

  • adds a missing check digit to (00), (01), (02), (402) and the (41x) location numbers, and rejects a wrong one;

  • checks dates are YYMMDD and that text fields use only the GS1 character set;

  • moves fixed-length fields to the front and puts FNC1 after any variable-length field that is not last (7.8.6);

  • refuses more than 48 data characters, and warns past 165.10 mm wide (5.4.4.3).

Sizing a Code 128

Code 128 has no fixed size: the application decides. Pick an X-dimension your printer prints cleanly, with a printer setting that rounds it to whole dots, and keep a quiet zone of 10X each side. For GS1-128 on cases GS1 sets X from 0.495 mm to 1.016 mm and bars at least 31.75 mm tall (symbol specification table 2); on pallet labels the maximum X is 0.940 mm (table 5).

How to make one

  1. Choose Code 128 or GS1-128.

  2. Type the text or the GS1 data. Characters outside printable ASCII are rejected with a plain explanation.

  3. Set the X-dimension and bar height, and the printer if it is a label printer.

  4. Download, print the test sheet, and scan it.

Common questions

Why does my GS1-128 scan as plain text with no AIs?

Scanners transmit FNC1 separators as the GS character (ASCII 29) and flag GS1 data with the symbology identifier ]C1. Turn on symbology identifiers or GS1 parsing in the scanner, as GS1 recommends (5.4.7.4).

Code 128 A, B or C?

You do not need to choose. The generator picks code sets B and C per character to make the shortest symbol, which is what ISO/IEC 15417 and GS1 (5.4.7.6) recommend.

Can I use lowercase and spaces?

Yes. Code 128 encodes upper and lower case, digits, spaces and keyboard punctuation.

WHERE MORSA FITS

Scanned it in. Is it all there?

A barcode tells receiving what arrived. Morsa matches it against the purchase order line, flags what is short or wrong, and chases the supplier for the rest, in email, Teams, WhatsApp or whatever you already run on.

Machines, people, and vendors, finally in one. We start with yours.

For queries, feedback or suggestions

© 2026 Lunar Inc. All Rights Reserved.

Machines, people, and vendors, finally in one. We start with yours.

For queries, feedback or suggestions

© 2026 Lunar Inc. All Rights Reserved.

Machines, people, and vendors, finally in one. We start with yours.

For queries, feedback or suggestions

© 2026 Lunar Inc. All Rights Reserved.