Code 128 Barcode Generator

Turn letters, digits and symbols into a Code 128 barcode for shipping and inventory labels.

Options
Keep dark bars on a light background so scanners can read the code.
Print size Free

Preview: Code 128

Drawing barcode…

Built by DevChecked against GS1 and ISO/IEC rulesLast reviewed:

  • Free, no sign-up
  • PNG and SVG download
  • Check digits added
  • Made in your browser

This Code 128 barcode generator encodes letters, digits, spaces and symbols (up to 80 characters) into a compact Code 128 barcode, picks the shortest code set for your data and adds the required check character. Download it as PNG or SVG, free and without sign-up.

How to make a Code 128 barcode

  1. Type the text or number you want to encode, such as a SKU, a bin location or a serial number.
  2. Set the bar height and size, and choose whether to show the text under the bars.
  3. Download the PNG or SVG file, or print it.

What is Code 128?

Code 128 is a high-density linear barcode defined in the standard ISO/IEC 15417. It can encode all 128 ASCII characters, so it handles upper and lowercase letters, digits and punctuation in one barcode.

Every Code 128 barcode has the same parts in order: a quiet zone, a start character, the data, a check character, a stop character and a second quiet zone.

Code 128 code sets A, B and C

Code 128 has three character sets. The start character tells the scanner which set the barcode begins with, and the barcode can switch sets in the middle.

Code setEncodesStart value
AUppercase letters, digits, symbols and control characters103
BUppercase and lowercase letters, digits and symbols104
CPairs of digits from 00 to 99105

Code set C packs two digits into each character, so a long number makes a barcode about half as wide. This generator switches between the sets for you to keep the barcode short.

How the Code 128 check character works

The check character is required in every Code 128 barcode. Each character has a value; the start value is added to each data value multiplied by its position, and the remainder after dividing by 103 is the check value.

Example: for Code128 in code set B, the sum is 104 + (35×1) + (79×2) + (68×3) + (69×4) + (17×5) + (18×6) + (24×7) = 1,138. 1,138 divided by 103 leaves 5, so the check value is 5. The generator does this for you; you never type it.

Code 128 vs Code 39 vs GS1-128

  • Code 39 accepts only 43 characters (A to Z, 0 to 9 and 7 symbols) and makes a wider barcode for the same data.
  • Code 128 accepts the full ASCII set and is more compact for the same data.
  • GS1-128 is Code 128 with a special FNC1 character and GS1 application identifiers, used on shipping labels between companies. Choose GS1-128 in the type menu above and type the data with the identifiers in brackets, for example (01)09501101530003(10)AB-123.

Retail checkouts read UPC and EAN, not Code 128. For a product barcode, use the UPC barcode generator.

What Code 128 is used for

Code 128 is common on shipping labels, warehouse bins, stock keeping units (SKUs), asset tags and library cards. When you have a whole list of codes to label, the bulk barcode generator makes them all at once.

Is it private?

Yes. The barcode is drawn in your browser. The text you type is not sent to our server.

Tips for Code 128 labels

  • Keep the text short; every extra character makes the barcode wider.
  • Use digits only where you can, so the generator can use the compact code set C.
  • Leave blank space at both ends of the barcode.
  • Keep the text under the bars on, so staff can type the code if a scan fails.
  • Test the label with your own scanner before printing a full roll.

Related tools

Frequently asked questions

How many characters can I encode?

This page accepts up to 80 standard keyboard characters. Longer barcodes get too wide for most labels.

Can Code 128 hold lowercase letters?

Yes. Code set B includes lowercase letters, and the generator selects it when your text needs it.

Do I need to add the check digit?

No. The check character is calculated and added for you.

How tall should a GS1-128 label barcode be?

GS1 sets 32 mm as the height for GS1-128 in general distribution, such as pallet and case labels.

Is Code 128 the same as GS1-128?

No. GS1-128 is Code 128 with an FNC1 character and GS1 application identifiers. Both are available on this page.

Can I use Code 128 on products sold in stores?

No. Store checkouts read UPC and EAN barcodes. Code 128 is for shipping, inventory and internal labels.