Code 128 Barcode Generator: How It Compares to the Alternatives
Reviewed by the OnlineFree.app team · Updated
Key points
- Code 128 encodes all ASCII characters from 0 to 127 and always adds a mod-103 checksum, so every symbol validates itself.
- Auto subset selection uses Code 128 C for even-length digit strings, which is roughly a third narrower than subset B.
- The Code 128 Barcode Generator runs entirely in the browser and exports print-safe SVG plus a 2× raster PNG.
- Module width, not bar height, decides whether a printed barcode scans; the default is 2 px per module.
- Code 128 is not a retail POS symbology — EU checkout labels need a GS1 GTIN in an EAN-13 symbol.
What does a Code 128 barcode encode?
Code 128 is a variable-length, high-density linear symbology that encodes the full ASCII range from 0 to 127, which is why it appears on shipping labels, shelf tags and internal SKU labels far more often than on grocery packaging. Every symbol character is exactly 11 modules wide; only the stop pattern is longer, at 13 modules.
The Code 128 Barcode Generator turns a short string into a finished symbol in one pass: type the text, watch the live SVG preview, then download it as SVG for print or PNG for a quick paste into a document. Under the preview it reports the subset it chose, the number of encoded characters, the mod-103 checksum value and the total module count.
Encoding happens in the browser. There is no signup, no install and no server round-trip, which is what makes it usable on a phone in an aisle when you need a label before the next pallet moves.
How does it compare to Code 39, EAN-13 and QR?
Code 39 is the obvious older alternative. It is self-checking, needs no checksum and handles uppercase letters and digits, but at the 3:1 wide-to-narrow ratio most scanners expect it is wider than Code 128 for the same mixed alphanumeric payload, and it cannot carry lowercase text. EAN-13 is a different job entirely: 13 digits, a GS1-issued GTIN, and the only symbology retail checkout accepts in the EU. QR codes hold far more data, but they need a 2D imager — a warehouse laser scanner that reads Code 128 all day may not read a QR at all.
That leaves Code 128 for anything internal: article numbers, order references, batch codes, carton labels, asset tags and SSCC-18 logistics references. It handles mixed letters and digits in one symbol, and its checksum makes a misprint obvious rather than silent.
Compared with desktop label software or barcode fonts, the trade-off is simply scope. A browser generator gives you one symbol at a time and no database connection; label software gives you templates, batch printing and a licence fee. For a one-off label, the free online tools route is faster. GS1 maintains the reference material on barcodes used in trade (GS1 barcodes), worth reading before you decide a Code 128 label is acceptable for a given supply chain.
Subsets A, B and C — which does Auto pick?
Subset B covers ASCII 32 to 127, meaning every printable character you would normally type into an SKU field, uppercase and lowercase included. Subset C encodes digit pairs, so each symbol character carries two digits instead of one, but only when the digit count is even. Subset A covers ASCII 0 to 95, control characters included, and rarely matters for labels.
Auto mode selects C when the payload is all digits with an even length, and B otherwise. The saving is measurable. The string 12345678 is 79 modules in subset C — start C, four digit pairs, one check symbol and the 13-module stop — against 123 modules in subset B, roughly a third narrower on the same label.
Mixed payloads such as the default ABC-1234 always encode in B: start B, eight data symbols, one check symbol, stop, which comes to 123 modules. At the default 2 px module width, with the two 10-module quiet zones included, that preview is 286 px wide. You can force A or B in the controls, but you cannot force C onto an odd-length digit string.
Getting module width and print size right
Module width is the parameter that decides whether a printed symbol scans. The default here is 2 px per module, adjustable from 1 to 6 in 0.5 steps, with the SVG width scaling live so you can see immediately when a value overruns your label stock. Bar height — 60 px by default, 20 to 200 allowed — affects how tolerant the symbol is to skew and how easily a human finds it, not whether the modules resolve.
Print from the SVG at 100% scale. Fit-to-page and shrink-to-fit resample the bars, blur module edges and are a very common cause of a barcode that looks perfect on screen and reads as nothing on paper. The 10-module quiet zones on each side are part of the symbol: the generator never trims them, but label templates frequently do.
The safe check is empirical. Export the SVG, print one label on the actual stock at the actual size, and scan it with the scanner you will really use. Check the decoded string character by character — an undersized symbol often scans as a truncated string rather than failing outright.
Checksums, limits and non-ASCII characters
Code 128 appends a mod-103 check symbol to every barcode: the start character's value plus each data character's value multiplied by its position, summed and reduced modulo 103. The generator computes it for you and shows the resulting value in the readout, which helps when you are checking a legacy label or comparing against a spec. The weighting table is documented in the Code 128 reference; scanners recalculate the checksum on every read and reject a mismatch, so a corrupted checksum behaves like a dead barcode.
Input is limited to ASCII 0–127. German product names are the classic failure here: ä, ö, ü and ß fall outside that range and will be rejected. Substitute ae, oe, ue and ss, or encode the numeric article number instead and keep the umlaut in the human-readable caption. If you are pulling values from a spreadsheet column, the Online Word Counter And Character Counter is a quick way to spot entries that are too long before you paste them in.
The generator warns past 48 characters and hard-stops at 80. That is not arbitrary: long payloads force you into either a module width too small for handheld scanners or a label too wide for the shelf, and both fail in the field. Treat any generated label as a draft until you have scanned it yourself.
Frequently asked questions
Is the Code 128 Barcode Generator free, and does it upload my data?
It is free and requires no signup. Encoding runs entirely in your browser, so the text you type is never sent to a server and the SVG and PNG are produced locally. That makes it reasonable for internal article numbers and order IDs, though you should still avoid encoding anything you would not be comfortable seeing on a printed label.
Can Code 128 be used for retail products in the EU?
Not for checkout. Retail point-of-sale scanning in the EU requires a GS1-issued GTIN carried in an EAN-13 or UPC-A symbol, and Code 128 is not a retail scanning symbology. It is widely used for internal SKUs, shelf labels, carton and pallet labels, logistics references and asset tags, where you control both the data and the scanner.
Why is my printed Code 128 barcode not scanning?
The usual causes are a module width below the scanner's minimum X-dimension, printing with fit-to-page scaling that resamples the bars, quiet zones trimmed away by a label template, or low contrast between bars and background. Regenerate from the SVG at 100% scale, keep the 10-module margins blank, and test on the scanner you will actually use.
What does the checksum value in the symbol readout mean?
It is the mod-103 check symbol value that Code 128 appends to every barcode. The generator sums the start character's value and each data character's weighted value, divides by 103 and encodes the remainder as the final symbol character. Scanners recompute it on every read and reject a mismatch, so an incorrect checksum looks like a dead barcode.
How many characters can a Code 128 barcode hold?
There is no fixed theoretical limit, but practical limits arrive quickly. The Code 128 Barcode Generator warns above 48 characters and hard-stops at 80. Beyond that, either the module width drops below what your scanner resolves or the label becomes impractically wide, so split long data across fields or move to a 2D symbol.