Code 128 · EAN-13

Barcode generator

Code 128B or EAN-13, drawn as real bars with the quiet zone a scanner needs — the check digit is computed, never assumed.

The barcode is drawn in this tab as SVG. Nothing you type is sent anywhere.

Code 128B takes any printable ASCII. EAN-13 takes 12 digits, or 13 with the check digit.

Short answer: type the value, pick Code 128B or EAN-13, and download. The preview updates as you type, the EAN check digit is computed from your twelve digits, and the quiet zone is included so the code scans after printing.

Why the check digit is not optional

An EAN-13 barcode carries its own proof: a thirteenth digit derived from the first twelve. A scanner recomputes it and rejects the symbol if it disagrees, which is why a barcode can look perfect and still refuse to scan at the till. This tool either computes the digit or tells you the correct one — it never encodes a number that will fail.

Widths, not guesses

Code 128 draws four different bar widths, and EAN-13 draws two. Printing either at a module width the printer cannot resolve — under about 0.25 mm on a thermal label — blurs adjacent bars together. If a barcode scans on screen but not on paper, the module width is the first thing to raise.

Barcode questions

What is the quiet zone, and why does it matter?

It is the blank margin either side of the bars. A scanner needs it to find where the code starts and ends, and a barcode printed flush against another element fails on paper while looking fine on screen. Every barcode here is generated with a ten-module quiet zone built in, so you do not have to add one.

Why does EAN-13 refuse my number?

Because a 13-digit EAN ends in a check digit computed from the first twelve, and a wrong one produces a barcode no scanner will accept. The tool tells you the correct digit instead of quietly encoding a broken number. Type twelve digits and it calculates the thirteenth for you.

Code 128 or EAN-13?

EAN-13 is for retail products: exactly twelve digits plus a check digit. Code 128B encodes any printable ASCII, which is what you want for an invoice number, a serial, a tracking code or a file name. Subset C, which packs digit pairs, is not offered because it needs a mode switch mid-symbol.

Will the PNG be sharp when printed?

The PNG is rendered at four times the SVG size with smoothing off, so the bars stay hard-edged. For anything going to a label printer, download the SVG — vector bars have no pixel grid to land on, and the printer renders them at its own resolution.

Related tools