Code 128 barcode generator

Generate a Code 128 barcode for an asset tag, a carton number or a shelf label

The tool loads here. It needs JavaScript, because the work happens on your device.

Your files and your privacy

The value you type is encoded on your own device and the bars are drawn there; nothing is uploaded and nothing is stored between visits. This product generates barcodes only: it contains no scanner, asks for no camera permission, and has no way to read a code you point at it.

What this tool does

Turn a short ASCII value into a Code 128 barcode and export it as a PNG or an SVG, with the value optionally printed under the bars. The encoder picks the code set, packs digit runs two to a symbol and adds the required check character.

It converts a short ASCII value — an asset tag, a carton number, an internal reference — into a Code 128 bar pattern and draws it as a PNG or an SVG, optionally with the value printed underneath in a monospace line. Any character above ASCII 127 is refused with the offending characters named, rather than dropped or substituted: a barcode that has silently lost a character is worse than one that was never made. This product generates only, and asks for no camera permission.

How to use it

  1. Type the value into the Code 128 panel. The preview redraws as you type, and an unsupported character produces a message naming it.
  2. Decide whether to print the value under the bars. Leave it on unless the label has no room, because it lets a person read a code a scanner cannot.
  3. Set the bar and background colours if you need something other than black on white, and watch the contrast warning.
  4. Export SVG for a label template or PNG for a document, then scan the printed result with the scanner that will be used in practice.

Example use cases

Supported input and output

Accepts

Produces

What this tool will not do

Common mistakes

Technical notes

Encoding uses the automatic Code 128 encoder from jsbarcode, which selects the starting code set and inserts the switch characters itself: a run of digits is encoded in set C at two digits per symbol, which is why twelve digits give a 101-module pattern while eleven letters and punctuation give 145. Each symbol is eleven modules wide, with a start pattern, the modulo-103 check character and a thirteen-module stop pattern around the data. Characters above ASCII 127 are rejected before the encoder is reached, and its own validity check is honoured as a second gate.

Frequently asked questions

Do I need to add a check digit myself?
No. The modulo-103 check character is calculated during encoding and included in the bars. Adding your own would make it part of the encoded data instead.
Can it produce EAN or UPC codes for retail products?
No, only Code 128. Retail numbering formats depend on registered company prefixes and their own check-digit rules, and a plausible-looking but wrong retail barcode causes real problems downstream.
Can it scan or decode a barcode?
No. This product generates codes and nothing else. There is no scanner, and it never requests access to a camera.