Code 128 Barcode Generator

Enter a value and generate its Code 128 barcode. The image includes the text beneath the bars.

Runs locally in your browser

How to turn a value into a Code 128 barcode image

Type a value and press Generate barcode: the page draws a Code 128 barcode as a PNG image and prints the encoded text under the bars. The drawing happens in your browser, and the value is not sent anywhere.

The page opens with a sample barcode for voritools.com, so the output format is visible before you type anything.

  1. Type or paste the value into the field. Letters, digits, spaces, punctuation and the Latin-1 letters È–Ï are encoded.
  2. Press Generate barcode. The image below the buttons is replaced; digits are packed two per symbol, so a numeric value stays narrower than the same number of letters.
  3. Press Clear to empty both the field and the image. To keep the result, right-click the image — or long-press it on a phone — and save it; there is no separate download button.

What the generator encodes and where it stops

Characters that encode, characters that do not

Testing covered the ASCII range and part of Latin-1. A–Z, a–z, 0–9, space, tab and the punctuation of a standard keyboard all encoded, as did È, Ï and the letters between them. Values outside that set failed: é, ü, ñ, ß, the euro sign, Chinese characters and emoji are not part of the character set this build accepts.

When the value contains a character the encoder rejects, the tool clears the previous image and shows a message instead of leaving a stale or partial barcode on screen.

How far the image stretches

Width grows by roughly 22 pixels per letter and 11 pixels per digit, plus about 90 pixels of fixed margin: a 4-character value measured 178 pixels, 120 characters measured 2,730 pixels, and the height stayed at 142. Nothing wraps, so a long value produces a long image.

Browsers refuse to export a canvas past their own size limit, and the PNG export fails without raising an error. In testing 2,800 characters still produced an image and 3,000 did not; the tool now reports that the value is too long instead of leaving the frame empty.

One symbology, no product data

The page always draws Code 128. It is not an EAN/UPC, Code 39, Data Matrix or QR generator, and it does not check whether a value is a valid retail number: a plain digit string is encoded exactly as typed, with no check digit added.

If the scanner that will read the barcode expects a particular format, generate a sample first and read it with the device you plan to use.

Recent tools: