Code 128 is the barcode for everything that is yours: asset tags, shelf locations, order and batch numbers, membership cards. It carries letters, digits and punctuation at any length, needs no number issued by anyone, and every ordinary scanner reads it. The symbol is drawn with its check character and quiet zone in place.
What it holds
All 128 ASCII characters: capitals, lower case, digits, spaces and ordinary punctuation, with no fixed length. The symbol grows wider with every character, so a fifty-character code is a long strip. Anything outside ASCII, such as an accented letter or an em dash, is refused rather than swapped, because a scanner would then read something other than what you meant.
The three code sets
Code 128 switches internally between set A (capitals and control characters), set B (upper and lower case) and set C (pairs of digits packed into one symbol). The encoder here starts in whichever set makes the symbol shortest and switches mid-stream when that saves space, so a run of digits comes out at roughly half the width of the same digits as text.
The check character
Every Code 128 symbol ends in a check character, a weighted sum of everything before it, modulo 103. A scanner recomputes the sum on each read and rejects a mismatch, so a smudged bar produces no read rather than a wrong one. It is drawn for you; there is no Code 128 without it.
Text that is refused
Code 128 here carries ASCII only. If you type a character outside it, the tool names that character and stops, and tells you the letters A to Z and a to z, digits, spaces and ordinary punctuation are all fine.
Sizing a Code 128 label
There is no nominal size. What matters is the narrowest bar, which should be at least 0.19 mm for a handheld scanner and more for a fixed one, and a quiet zone of ten modules each side, which is drawn into the file. Scale proportionally, print black on white, and take the SVG for thermal printers.
The short answer
Code 128 turns any ASCII text — letters, digits and punctuation, at any length — into a barcode ordinary scanners read, and it needs no number from anybody. Its last symbol is a check character: a weighted sum of everything before it, divided by 103, whose remainder the scanner recomputes to reject a misread. Use it for anything you label yourself; a product sold in shops needs an EAN-13 or a UPC-A instead.
The check character, worked through
Take “shelf-b4”, a shelf label — the kind of thing Code 128 is for. The encoder draws it in code set B, where a character's value is its ASCII code minus 32. The start symbol counts once; each character is multiplied by its position.
Check character for “shelf-b4”
Symbol
Value
Weight
Product
Start B
104
×1
104
s
83
×1
83
h
72
×2
144
e
69
×3
207
l
76
×4
304
f
70
×5
350
-
13
×6
78
b
66
×7
462
4
20
×8
160
Sum
1892
1892 divided by 103 leaves 38 (18 × 103 = 1854), so the check symbol is value 38. It is drawn as the last symbol before the stop symbol; it is not printed under the bars, and the scanner checks it without passing it on (GS1 General Specifications, Release 26.0 (January 2026), section 5.4.7.5.1, for the GS1-128 subset).
Is there anything to register before using Code 128?
No. Code 128 is a symbology, not a numbering system, so it draws whatever you type. Registration is a question only for retail product codes, where the number itself names a company. Inside your own organisation, use your own scheme.
Should I pick Code 128 or a QR code?
If a till scanner, a warehouse gun or a form reader will read it, pick Code 128. If a phone camera will, pick a QR code: it holds more, survives damage, and phones do not read Code 128 without an app. This site has a QR tool beside this one.
What does GS1-128 add to Code 128?
A defined structure inside the symbol: application identifiers such as (01) for a product number and (17) for an expiry date, used on shipping labels. This tool draws plain Code 128 and does not insert the FNC1 character that marks GS1-128.
Why has my Code 128 barcode come out so wide?
Because Code 128 spends eleven modules on every character and your text is long. Packing digits helps, since a number-only code is about half the width, and so does shortening the text. A QR code or Data Matrix suits long content.
We count page views with our own analytics, which sets no cookie and stores no analytics identifier in this browser. Your choice below is about advertising: if it is switched on here, our partners may store and read information on your device. How we use it