Barcode Generator
Make a scannable barcode, or a sheet of them, and print it at the right size.
Loading…
About the Barcode Generator converter
Type a value, get a barcode that scans. Code 128 for anything text, EAN-13 and UPC-A for retail products, EAN-8 for small packets, ITF-14 for outer cases — with the check digit worked out for you and a printable sheet if you need a hundred of them.
It is generated on your device and downloads as SVG, which matters more for a barcode than for most graphics: the code is a set of exact widths, and a vector keeps them exact at any size.
A barcode is not a picture of a number
It is the number written in a code whose alphabet is stripes. The unit is the module — the width of the narrowest bar — and everything a scanner reads is the ratio between widths, not their absolute size. That is why the same code works on a postage stamp and on the side of a lorry, and why the accuracy of the widths matters far more than the resolution you print at.
It also explains the advice to take the SVG rather than the PNG. A bitmap scaled to fit a label ends up with bars a pixel and a half wide; the printer rounds each one independently, some up and some down, and the scanner measures ratios that no longer match anything. Lines defined in real units cannot drift that way.
The blank margin is part of the barcode
The empty space either side is called the quiet zone and it is specified, not decorative. A scanner uses it to find where the symbol starts and stops. A barcode set flush against a border, a block of text or the edge of a label will often not read at all, however crisp the bars themselves are.
It is included in everything generated here and should not be cropped off. If a label is too tight to fit it, the answer is a narrower module, not less margin.
What the check digit is for
The last digit of a retail barcode is calculated rather than chosen. Every second digit counts three times and the rest count once, and the check digit is whatever brings the total to a multiple of ten. Type the digits without it and it is worked out and added.
The alternating weights are the point. Transposing two neighbouring digits is the commonest way to mistype a number, and a plain sum would not notice it at all — the total is the same. Weighting alternate positions differently means a swap changes the total, so the scanner rejects it. A barcode with a wrong check digit does not scan incorrectly; it simply does not scan.
The trick inside EAN-13
An EAN-13 has room for twelve digits of bars and carries thirteen. The first digit is never drawn. Each of the six left-hand digits can be printed using either of two different pattern sets, and which sets are used — read as a pattern of six choices — encodes the missing digit. The scanner reads that parity, looks it up in a table of ten, and recovers a digit that appears nowhere in the stripes.
The same mechanism tells a scanner which way up it is reading. The left-hand patterns always have an odd number of dark modules and the right-hand ones an even number, so a symbol read backwards is recognisably backwards and can simply be reversed.
A UPC-A, incidentally, is an EAN-13 whose invisible first digit is zero. That is why an American product scans perfectly well in a European shop.
Which one to use
Code 128 for anything internal: asset tags, shelf locations, work orders, serial numbers, inventory labels. It takes any printable character and packs digits two to a symbol, so it is also the most compact of these for a long number.
EAN-13 or UPC-A only if you are selling through retail, and only with a number properly allocated to you — those namespaces are administered, and inventing one produces a code that scans as somebody else's product. EAN-8 exists for packets with no room for a full EAN-13. ITF-14 goes on the outer case rather than the item, and prints reliably on corrugated cardboard, which the finer codes do not.
Code 39 is not here
Deliberately. Code 128 encodes the same characters in appreciably less space and has a proper check digit, and there is no reason to pick the older symbology for new work unless a scanner or system downstream cannot read anything else.
If something of yours genuinely requires it, that is a real constraint and worth knowing before you print a run — but it is worth checking first, because most equipment sold this century reads Code 128 perfectly well.
Frequently asked questions
Can I use this for products I sell in shops?
Only with a number allocated to you. EAN and UPC numbers are administered, and one you invent may already belong to another company's product — the barcode will scan, and it will scan as the wrong thing. For anything internal, Code 128 needs no registration at all.
SVG or PNG?
SVG whenever the thing you are pasting into accepts it. A barcode is a set of exact widths and a vector keeps them exact at any size, while a scaled bitmap gets bars that land between pixels and read as the wrong ratios.
It will not scan. What is wrong?
Most often the quiet zone has been cropped, or the code has been printed too small for the printer to hold the narrow bars cleanly. Try a wider narrow bar first. Also check it is on white — a tinted or patterned background lowers the contrast a scanner needs.
Do I type the check digit?
No. Give the digits without it and the last one is calculated and added. Twelve digits for EAN-13, eleven for UPC-A, seven for EAN-8, thirteen for ITF-14.
Can I make a lot at once?
Yes. Switch to the sheet, paste one value per line, choose how many columns and print. The whole sheet is laid out for A4 with the margins a scanner needs between codes.
Is anything uploaded?
No. The bars are computed and drawn in your browser. Nothing about the values you encode is sent anywhere, which matters if they are order numbers or customer references.