Barcode Generator

Create EAN-13, EAN-8, UPC-A, Code 128, Code 39, ITF-14 and Codabar barcodes. It works out the check digit for you and downloads as SVG or PNG. All in your browser.

Format

12 data digits + 1 check digit

The check digit was missing. We calculated it: 7.

Preview
Settings

Everything is generated in your browser. The value is never sent to any server.

Compartir

What this tool does

It generates barcodes in eight symbologies — EAN-13, EAN-8, UPC-A, ITF-14, ITF, Code 128, Code 39 and Codabar — with a live preview and SVG or PNG download. Everything is drawn in your browser.

What sets it apart from most is what it does when the value is not valid. Instead of a generic “invalid input”, it tells you what is wrong: how many digits are missing, what the check digit should be (with a button to fix it), and if you type only the data, it works out the missing digit and points it out.

Which format you actually need

This is the decision that matters, and the one almost nobody explains.

EAN-13 and UPC-A — retail products

These are the ones on supermarket packaging. EAN-13 is the standard in Europe and Latin America; UPC-A in the United States and Canada. They carry 12 and 11 data digits respectively, plus the check digit.

An important warning: the number has to be assigned to you by GS1, the organisation that runs the system. You do not make it up. You can generate the image here freely, but if you sell in shops using a number that is not yours, you will cause conflicts in retail systems, because that code points at another company’s product.

Code 128 — inventory and internal use

If the code is yours and never leaves your operation — warehouse labels, assets, case files, internal orders — this is the one you want. It accepts letters, numbers and symbols, depends on no registry, and is compact. It is also what sits underneath the GS1-128 used in logistics.

ITF-14 — the case, not the unit

It identifies the grouping: the box holding twelve units of the product that carries its own EAN-13. It is printed on corrugated cardboard, where print quality is poor, which is why its bars are thick and forgiving.

Code 39 — the veteran

Older than Code 128 and less dense, so it takes more space for the same content. It only accepts uppercase letters, digits and a handful of symbols. It survives in industrial and defence settings because there are old scanners that understand nothing else. For anything new, pick Code 128.

Codabar — libraries and blood banks

It survives in very specific niches. It requires a letter from A to D as a delimiter at the start and at the end.

The check digit, where nearly every error comes from

EAN and UPC codes end in a digit that is not free: it is calculated from the preceding ones. Its job is to let a scanner detect a bad read instead of returning the wrong product.

The calculation is the same for EAN-13, EAN-8, UPC-A and ITF-14. You walk the data digits from the right, multiplying alternately by 3 and by 1, add it all up, and the check digit is whatever is needed to reach the next multiple of ten.

With the EAN-13 590123412345:

digits (from the right):  5  4  3  2  1  4  3  2  1  0  9  5
weights:                  3  1  3  1  3  1  3  1  3  1  3  1
product:                 15  4  9  2  3  4  9  2  3  0 27  5
sum = 83  →  next multiple of ten = 90  →  check digit = 7

The complete code is 5901234123457.

The classic mistake when implementing this by hand is weighting from the left, which gives the same answer only when the digit count is even and fails otherwise. If you type a real product’s code and this tool says the check digit does not add up, first check whether you skipped or duplicated a digit: that is what happens ninety per cent of the time.

SVG or PNG

Download SVG whenever the destination accepts it. A barcode is a precision drawing: the scanner tells bars apart by their relative width, so any blurriness or pixelation makes its life harder. SVG is vector and prints sharp at any size; PNG degrades as soon as you scale it.

Save PNG for when the system you are pasting into does not take vectors.

Tips for codes that actually scan

  • Do not shrink it below what the standard allows. An EAN-13 printed under 80% of its nominal size starts causing problems.
  • Respect the quiet zone. The white areas at both ends are not decoration: the scanner needs them to know where the code starts and ends. That is the “margin” setting in this tool.
  • High contrast, dark bars on a light background. Classic scanners use red light, so red bars on white are nearly invisible to them. Black on white never fails.
  • Do not stretch it horizontally. Changing the aspect ratio alters the relative width of the bars, which is precisely the information being encoded. Scale proportionally or, better, regenerate the code at the bar width you need.

About the rendering

Rendering uses JsBarcode (MIT licence), loaded only when you open this page. The validation and check-digit calculation are our own, so the tool can explain the error rather than merely reject it.

Frequently asked questions

Which barcode format do I need?

If you are selling a product in shops, EAN-13 in Europe and Latin America or UPC-A in the United States and Canada — and the number has to be assigned to you by GS1, you cannot make it up. For internal use — inventory, assets, warehouse labels — use Code 128, which accepts letters and numbers and depends on no registry. ITF-14 is for the shipping case that groups several units.

What is the check digit and why am I getting an error?

It is the last digit of EAN and UPC codes, and it is not free: it is calculated from the preceding ones so a scanner can tell whether it misread the code. If you type a product's 13 digits and the last one does not add up, it is almost always a typo. This tool tells you what it should be and offers to fix it in one click. If you type only the 12 data digits, it works out the thirteenth for you.

Can I use these codes to sell in shops?

The image is valid and any scanner will read it. What this tool cannot give you is the number: EAN and UPC codes for retail products are assigned by GS1 to each company, and using one that is not yours causes conflicts in shops' systems. For internal use, on the other hand, you can make the number up freely.

Should I download SVG or PNG?

SVG whenever you can. It is vector, so it prints sharp at any size, and that matters a great deal on a barcode: if the bars come out blurry or pixelated, scanners fail. Use PNG only when the system you are pasting into does not accept SVG.

Is anything uploaded to a server?

No. The barcode is drawn in your browser with JavaScript and the download is generated locally. No network request fires when you generate, which you can confirm in the network tab of your developer tools.

Reviews & ratings

No reviews yet. Be the first to leave one!

Write a review

Your rating *