Skip to content
SUMILORASUMILORA

Generate a barcode

Everyday tools

Enter a number and get a barcode. The check digit is worked out for you, and the result is an SVG that scales without blurring.

Runs in your browser

Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.

About this tool

The check digit, and why a wrong one is dangerous

The last digit of an EAN or UPC is calculated from the others: each digit is weighted 3 or 1 alternately from the right, summed, and the check digit is whatever makes the total a multiple of ten.

Here is the part that matters. A barcode with the wrong check digit still scans — it simply reads as a different number. Nothing complains, nothing looks broken, and nobody finds out until a shipment is rejected or the wrong product rings up. So leave the digit off and let it be calculated; if you enter a full code, it is verified and refused if it does not add up.

Which one to use

EAN-13 is retail outside North America and, increasingly, inside it. UPC-A is North American retail — and is the same symbology: a UPC-A is an EAN-13 whose first digit is zero, which is why a European scanner reports thirteen digits where an American one reports twelve.

EAN-8 is for packages too small for a full EAN-13. It is not a shortened EAN-13: the numbers are allocated separately, and you cannot make one from the other.

Code 128 is for logistics and internal labelling. It takes letters as well as digits, has no fixed length, and packs runs of digits two to a symbol — which makes it the narrowest of the four for a long number.

Printing one that reads

Take the SVG and let the printer scale it. A bitmap enlarged to fit a label is the usual reason a barcode fails, exactly as with QR codes.

Keep the blank margin either side — retail asks for ten narrow bars’ worth — and do not squeeze the width to make it fit. A scanner measures the ratios between bars, so a horizontally compressed barcode is not a smaller barcode, it is a broken one. Making it shorter is fine; making it narrower is not.

Getting a number you are allowed to use

A barcode is only a way of writing a number. For a product sold in shops the number itself has to be allocated to you, by GS1 in your country, and a code you invent may already belong to somebody else.

For anything internal — asset tags, shelf labels, your own warehouse — invent whatever you like, and Code 128 is usually the better choice because it takes letters and has no allocation to worry about.

Questions

Do I need to buy a barcode number?

For retail, yes: EAN and UPC numbers are allocated by GS1, and an invented one may already belong to another product. For internal use — asset tags, shelves, your own stock — use anything, and prefer Code 128.

Why was my 13-digit number refused?

Because its last digit does not match what the other twelve produce. Either a digit was mistyped, or the number you have is twelve digits and the thirteenth should be calculated — leave it off and it will be.

Can I make the barcode narrower to fit a label?

Shorter, yes. Narrower, no: a scanner reads the ratio between bar widths, so compressing it horizontally produces a barcode that will not read at all.

Is a UPC-A the same as an EAN-13?

The same symbology, yes. A UPC-A is an EAN-13 with a leading zero, which is why this tool encodes it that way and then prints the twelve digits a UPC is normally shown with.

Related tools