How to use this barcode generator
Type the text you want to encode — a stock code, an asset number, a shelf location, a serial number — and the barcode redraws itself as you type. Two settings control the output. Bar width (the module size) scales the whole symbol: the narrowest bar in a barcode is called a module, and every wider bar is a whole number of modules, so choosing 3 or 4 pixels per module produces a proportionally larger, crisper PNG for big labels. Bar height makes the bars taller without changing the width, which helps scanners reading labels at awkward angles. The checkbox keeps the human-readable text printed beneath the bars, which is worth leaving on for almost every real-world label.
When the preview looks right, press “Download PNG” and the barcode saves as an image file you can drop into a label template, a document or a spreadsheet. Print one label first and scan it with the actual scanner or phone app your team will use — that thirty-second test catches printer scaling problems that no generator can see from inside your browser. The encoder itself is implemented from the published CODE 128 specification in this page's own code; nothing is sent to a server, and the symbol it draws includes the start character, the checksum and the stop character exactly as the standard requires.
Example: how “ABC” becomes bars
CODE 128 set B gives every character a number: A is 33, B is 34, C is 35. Encoding “ABC” therefore produces the value sequence 104 (the “start B” instruction), then 33, 34, 35, then a checksum, then 106 (stop). The checksum is worked out by multiplying each value by its position and dividing by 103: (104 + 33×1 + 34×2 + 35×3) = 310, and 310 mod 103 = 1, so the checksum character is value 1. Each value then maps to a fixed pattern of three bars and three spaces — value 104, for example, is drawn with bar widths 2-1-1-2-1-4 modules. String those patterns together with a blank quiet zone at both ends and you have the finished symbol: six characters of data and protection, drawn as 68 narrow modules in total.
CODE 128, QR codes and retail barcodes — which does what?
These formats are often confused because they all look like machine-readable patterns, but they solve different problems. CODE 128 is a one-dimensional strip: superb for short codes you control yourself — inventory, assets, documents, warehouse bins — and readable by the cheapest laser scanners. A QR code is two-dimensional: it holds far more data, including web links and non-Latin text, survives partial damage, and is read by phone cameras rather than laser scanners; our QR Code Generator makes those. EAN and UPC codes, the ones on shop products, are not a format you can simply adopt — the numbers in them are registered to manufacturers through GS1 so that no two products on Earth share a code. For anything inside your own four walls, CODE 128 is the professional default; for checkout, you need a registered number first.
Printing labels that scan first time
Most scanning failures are printing failures. Keep the symbol at least 25–30 mm wide for handheld scanners, print at the printer's native resolution, and never let a “fit to page” option stretch or squash the image — bars must stay in exact proportion. Leave the white quiet zone around the symbol empty, prefer matte labels over glossy ones that bounce the scanner's light back, and keep the contrast honest: black bars on white is the standard for a reason, and coloured bars on coloured backgrounds are the most common reason a fresh batch of labels refuses to scan.
Frequently asked questions
What is CODE 128?
CODE 128 is one of the world's most widely used linear barcode formats. It packs letters, numbers and punctuation into a compact strip of bars and spaces, and it carries a built-in checksum digit, so scanners can detect a misread instead of silently accepting the wrong value. Warehouses, couriers, libraries and stockrooms rely on it daily.
Will scanners read barcodes made here?
Yes — the generator builds a standards-compliant CODE 128 symbol, checksum and quiet zones included, and any ordinary 1D barcode scanner or phone scanner app can read it. Always print one test label and scan it before producing a whole batch, because printer scaling is the one step outside this tool's control.
What characters can I encode?
Uppercase and lowercase letters, digits and common punctuation — the printable ASCII range. That covers product codes, SKUs, asset tags and serial numbers comfortably. Emoji and non-Latin scripts cannot be represented in CODE 128 set B; for those, a QR code is the right format.
Can I use these barcodes on products I sell in shops?
Not for retail checkout. Shop tills expect registered EAN or UPC numbers issued by GS1, and inventing your own can collide with another product. CODE 128 is the right choice for your own internal labels — inventory, shelving, equipment, documents and warehouse locations — where you control the numbering.
What size should I print the barcode?
Bigger and crisper always scans better. As a rule of thumb, keep the printed symbol at least 25–30 mm wide for handheld scanners, print at the printer's native resolution without “fit to page” scaling, and keep dark bars on a plain light background. The module width option lets you generate a larger PNG for big labels.
Why will my barcode not scan?
The usual culprits are printing too small, stretching or squashing the image so the bars are no longer proportional, cropping into the blank quiet zone at either end, low contrast, or a glossy surface reflecting the scanner's light. Reprint larger, keep the aspect ratio locked and leave white space around the symbol.
What is the quiet zone?
It is the blank margin — at least ten narrow-bar widths — that must surround the barcode so the scanner can tell where the symbol starts and ends. This generator adds it automatically; when you place the PNG on a label, do not let text or borders intrude into it.
Should I show the text under the bars?
Usually yes. The human-readable line lets staff type the code when a label is damaged or a scanner is unavailable, and it makes visual checking easy. It costs nothing in scannability — scanners ignore it. Turn it off only when a design genuinely has no room.
Is my data uploaded, and can I use the barcodes commercially?
Your text is never uploaded — the barcode is drawn on a canvas in your own browser. And yes, barcodes you generate are yours to use, commercially or otherwise, with no licence or attribution needed.