Code 128 Barcode Generator

Create scannable Code 128 barcodes from text or numbers in your browser.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

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.

ContentCode set chosenWhy
INV-2048Bmixed letters and digits
40700123Clong even run of digits, packs 2 per symbol
Box ABcontains a space and letters

Everything is rendered locally on a canvas — your text and the generated image are never uploaded.

Ad placeholder (rectangle)