Text and data

Code 128 barcode generator

Any text, any length, no registration.

On this device

Type what the barcode should say

Any ASCII text, any length. Digits are packed two to a symbol so a long number stays narrow.

Code 128 carries letters and digits, any length, and needs no registration — use it for anything of your own. EAN-13 and UPC-A are retail product codes and need a number issued to you; UPC-A is the North American one.

Any ASCII text — letters, digits, spaces and punctuation. Nothing is uploaded: the code is drawn on this device.

SizeCode 128 · medium
Size

The width of the narrowest bar, in pixels. Wider scans more reliably from further away and makes a larger file; the SVG is sharp at any size regardless.

Taller bars give a scanner more chances to find a clean line across the symbol, which is why retail barcodes are as tall as they are.

What this tool does, exactly

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. Type the text and 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 — an accented letter, an em dash — is refused rather than silently swapped, because a scanner would read something different from 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, which is why a run of digits comes out at roughly half the width of the same digits in a text code. None of this is anything you have to choose.
The check character
Every Code 128 symbol ends in a check character computed as a weighted sum of everything before it, modulo 103. A scanner recomputes it on every read and rejects a symbol that does not match, so a smudged bar produces no read rather than a wrong one. It is drawn for you; there is no version of Code 128 without it.
Printing
Code 128 has 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 the quiet zone of ten modules either side, which is drawn into the file. Scale proportionally only, print black on white, and take the SVG for labels that go through a thermal printer.

About this tool

Do I need to register anything to use Code 128?

No. Code 128 is a symbology, not a numbering system — it draws whatever you type. Registration is only a question for retail product codes (UPC-A, EAN-13), where the number itself names a company. For anything inside your own organisation, Code 128 with your own scheme is the right answer.

Code 128 or a QR code?

If a scanner at a till, a warehouse gun or a barcode reader on a form is going to read it, Code 128. If a phone camera is going to read it, 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 is GS1-128?

Code 128 with a defined structure inside it: 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; it does not insert the FNC1 character that marks a symbol as GS1-128, so a label that has to follow that standard needs a tool that knows the application identifiers.

Why is my barcode so wide?

Because Code 128 spends eleven modules on every character and your text is long. Packing digits helps — a number-only code is about half the width — and so does shortening the text; there is no way to make a fifty-character Code 128 narrow, which is what QR codes and Data Matrix are for.

More text and data tools · All 50 · How they work