Code 128 barcode generator
Turn any text or number into a scannable Code 128 barcode and download it as a PNG. Code 128 is the high-density linear barcode used on shipping labels, retail packaging, asset tags and internal documents because it encodes the full set of ASCII characters in a compact space.
How it works
The generator follows the ISO/IEC 15417 specification. Each symbol is a value
0–106 drawn as six elements (three bars and three spaces) whose widths sum to 11
modules. The barcode is built as [START] [data] [CHECK] [STOP]. The tool
automatically picks Code Set C for runs of four or more even-length digits —
packing two digits per symbol — and Code Set B for letters and mixed text.
It then computes the weighted modulo-103 check digit (start value plus each
symbol value times its position, mod 103) and appends the 13-module stop pattern.
Quiet zones are added on both sides so scanners can lock on.
Example
Encoding ABC123 produces a Start B symbol, the symbols for A, B, C, then
a switch to Code C to pack 12 and 34-style pairs where applicable, followed
by the mod-103 check symbol and the stop bars. The result scans back to the exact
string ABC123.
| Content | Code set chosen | Why |
|---|---|---|
INV-2048 | B | mixed letters and digits |
40700123 | C | long even run of digits, packs 2 per symbol |
Box A | B | contains a space and letters |
Everything is rendered locally on a canvas — your text and the generated image are never uploaded.