Code 128, EAN-13, EAN-8, UPC-A and Code 39 as verified SVG or PNG
Code 128 Barcode Generator
Make the shortest possible Code 128 for any label text, letters and digits mixed.
Loading tool…
How to use code 128 barcode generator
Type the label text: letters, digits, punctuation or tab characters.
Set the bar width and height.
Check that the barcode reads back.
Download the SVG or PNG for your label printer.
What this tool does
- Chooses between sets A, B and C at every point to use the fewest symbols, packing digit runs two per symbol.
- Handles control characters such as tab through set A.
- Computes the modulo 103 check symbol.
- Shows invisible characters as dots in the printed text line so the label stays readable.
How the result is verified
Each bar width is read back from the PNG and the SVG, mapped to Code 128 symbols, the check symbol is recomputed and the text is rebuilt; it must match exactly before download.
Frequently asked questions
Why is my number shorter as a barcode than I expected?
Long runs of digits are encoded two at a time in set C, which nearly halves their width. The tool switches sets only where that saves space overall.
Code 128 or Code 39?
Code 128 is denser and holds lower case letters, so it fits more on a small label. Use Code 39 only when a system or old scanner asks for it.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
EAN-13 and EAN-8 retail barcodes with the check digit worked out
UPC-A barcodes for US and Canadian retail, check digit included
QR codes for links and text, with logo, colours and verified SVG or PNG