Code 128 Barcode Generator
Make a Code 128 barcode from letters, digits and symbols, or a GS1-128 barcode for shipping data, and save it as SVG, PDF or PNG at the X-dimension you set, without what you type leaving your device.
How to make a Code 128 barcode
Choose Code 128 or GS1-128
This page opens on Code 128. For data in GS1's Application Identifier format, press More types and choose GS1-128.
Type the data
For Code 128, type letters, digits, spaces and punctuation from the basic ASCII set; accented letters and other scripts are refused. For GS1-128, type each Application Identifier in parentheses followed by its data, such as
(01)00614141999996(10)A123. Without the parentheses the tool says "Put each GS1 application identifier in parentheses.", and a wrong field length or check digit gets "Check the GS1 identifiers, field lengths and check digits."Set the size
Type the X-dimension (mm), the width of the narrowest bar, which starts at 0.25 mm, and the Bar height (mm), which starts at 12 mm. The finished width, shown under the preview, depends on how much data you typed.
Download
Save it as SVG, PDF or PNG, or copy the image.
How each barcode is checked before release: how it works.
What Code 128 encodes: code sets A, B and C
Code 128 has three code sets. GS1 describes them this way: code set A holds capital letters, digits, punctuation and control characters (ASCII 0 to 95); code set B holds capital and lowercase letters, digits and punctuation (ASCII 32 to 127); code set C holds the 100 digit pairs from 00 to 99, so it packs two digits into each symbol character. Each character is 11 modules wide, which makes a run of digits in code set C half as long as the same digits in A or B.
A barcode can switch code sets partway through. The tool chooses the code sets for you, so you type the text and get the shortest barcode for it; you do not pick A, B or C. Every Code 128 barcode ends with a check character, which the tool adds and which is not printed in the text under the bars.
GS1-128
GS1-128 is a subset of Code 128 for data in GS1's format: a special character called FNC1 follows the start character, and GS1 reserves that position for its own system. The data is a chain of Application Identifiers, codes of two or more digits that say what follows, such as (01) for a GTIN, (10) for a batch number or (00) for a serial shipping container code. Scanners pass the identifiers on, so a warehouse system knows which number is which.
GS1 limits a GS1-128 barcode to 48 data characters and 165.10 mm (6.5 in) in length, including quiet zones of at least 10 times the X-dimension on each side. For labels on cases and pallets, GS1's logistics table gives an X-dimension of 0.495 to 0.940 mm and a bar height of at least 31.75 mm (1.25 in). The tool does not enforce the 48 characters or the length: count your data, and check the finished width under the preview.
Size and quiet zone
A Code 128 barcode grows with its data, so the same X-dimension gives a longer barcode for longer text. If it does not fit your label, shorten the data or lower the X-dimension, then test a printed copy with the scanner you will use: very narrow bars need a sharp printer. Keep the blank quiet zones at both ends: with Include quiet zones on, as it is when the page opens, the tool draws 10 times the X-dimension of white space on each side as part of the image.
Frequently asked questions
Is Code 128 the same as GS1-128?
GS1-128 is a form of Code 128. It uses the same bars, starts with the FNC1 character and holds data in GS1 Application Identifiers. Every GS1-128 barcode is a Code 128 barcode, but not the other way around.
Should I use Code 128 A, B or C?
You do not need to choose. The tool picks the code sets that make the shortest barcode for your text, switching between them where that helps.
Can Code 128 hold lowercase letters?
Yes. Code set B holds capital and lowercase letters, digits and punctuation. Accented letters such as é are not in the basic ASCII set, and the tool refuses them.
Does Code 128 need a check digit?
It has one built in: a check character before the stop character, which the tool calculates. It is not printed in the text under the bars.
Do I need a Code 128 font?
No. A font only works if your program also adds the start, stop and check characters. This page draws the whole barcode for you as an image.
Is what I type uploaded?
No. The barcode is drawn in your browser and what you type never leaves your device. The two analytics services on the site count visits and never see your data.