Barcode Generator
Type text or numbers → a Code 128 barcode. Download PNG or SVG.
How to make a barcode
- Type the text or number to encode, up to 80 characters. The barcode redraws as you type.
- Set the bar height and the bar width. Bar width is the thickness of the thinnest bar; everything else scales from it.
- Choose whether to print the text underneath, so that a person can read the code if a scanner cannot.
- Download a PNG for screens and documents, or an SVG for print, where it stays sharp at any size.
What Code 128 is
Code 128 is a linear barcode that can hold letters, digits and punctuation — the 95 printable characters from space to the tilde. It is compact, almost every scanner reads it, and it is the standard choice for shipping labels, warehouse bins, asset tags, library books, ID cards and internal stock codes.
Each character is drawn as three bars and three spaces that together are 11 units wide. The symbol begins with a start pattern, ends with a stop pattern, and carries a check character worked out from all the others, which lets a scanner reject a misread instead of returning the wrong value.
Why numbers make shorter barcodes
Code 128 has a mode that packs two digits into the space of one character. This generator switches to it automatically when it meets a run of four or more digits, so an order number such as 2026100412345678 comes out roughly half the width of the same number of letters. If your codes are for scanning only, an all-numeric scheme gives the smallest label.
When Code 128 is the wrong barcode
- Products sold in shops need an EAN-13 or UPC-A barcode with a number issued by GS1. A Code 128 symbol will not scan at a supermarket till.
- Web links, Wi-Fi details and contact cards are too long for a linear barcode. Use a QR code, which also survives damage better.
- Accented letters and other scripts are outside what this generator encodes. Stick to plain English letters, digits and common symbols.
Printing a barcode that scans first time
- Black on white. Scanners read contrast with red light, so dark bars on a light background work and coloured or reversed barcodes often do not.
- Leave a quiet zone. Keep a clear margin on the left and right at least ten times the width of the thinnest bar. Text or a border inside it is the commonest cause of a barcode that will not read.
- Do not stretch it. Resize in proportion. Squeezing the width changes the bar ratios and breaks the code.
- Keep the bars thick enough. A thinnest bar of about 0.25 mm or more prints reliably on an ordinary laser or label printer.
- Test before a print run. Scan a printed sample with the scanner or phone app you will really use.
Generate a Code 128 barcode from any text or number — useful for shipping labels, inventory, SKUs and product codes. Adjust the size, toggle the caption, and download a crisp PNG or a scalable SVG. It runs entirely in your browser.
What is Code 128?
A compact, widely-scanned barcode that encodes letters, numbers and symbols — common in logistics and retail.
Can I download an SVG?
Yes — download a vector SVG for print, or a PNG image.
More tools: QR Code Generator · Base64 Encoder