Barcode Generator

Developer

EAN-13, UPC-A, Code 128 and Code 39, with the check digit computed.

Barcode
5901234123457
95
Modules
9 each side
Quiet zone
7
Check digit
The first digit is not drawn as bars. It is carried by which of the two left-hand alphabets each of the next six digits uses, which is why the symbol is 95 modules rather than the 102 a straight count suggests.
The check digit 7 was computed and appended.
The white margin either side is part of the code. It is 9 modules wide and a scanner needs it. Cropping the image tight to the bars is the commonest reason a generated barcode will not read.
Encoded in your browser — nothing is sent anywhere. These symbologies are checked structurally and by decoding them back, which is not the same as a scanner. Test with a real reader before printing them on anything that matters.

How to use

What it's for

Make a barcode to print — for products you sell in shops, or for your own stock labels, shelves and asset tags.

Before you start

For goods sold in shops, have the product number issued to you by GS1; for your own labels, any code you choose will do. The barcode is drawn in your browser.

  1. Choose the barcode type

    Under Symbology, pick EAN-13 for products sold in shops, or UPC-A if a buyer asks for one. Choose Code 128 for your own labels with letters and numbers, or Code 39 when an old or simple scanner has to read it.

  2. Type the number or text

    Type it into Value, replacing the sample; the label says what this type accepts. For a shop code, type the digits without the last one — that check digit is worked out for you.

  3. Add a check character, for Code 39 only

    With Code 39, tick Add the modulo-43 check character only if your scanner or system expects one. Otherwise leave it off.

  4. Press Generate and look it over

    Press Generate to bring the barcode into view; it is redrawn as you type, with the number printed under the bars.

  5. Download it

    Press Download SVG to save an image that prints sharp at any size. Do not crop the white margin on either side — a scanner needs it.

Reading the result

  • Modules: how wide the bars are, counted in the thinnest bar's width. A longer value makes a wider code.
  • Quiet zone: the blank margin needed on each side. It is part of the code, so keep it when you print.
  • Check digit: a last digit worked out from the others so a scanner can catch a misread. It reads none for a type that does not print one, such as Code 128.

If it goes wrong

  • A note says the check digit should be different: another digit is probably mistyped. Check them against the original — a code with its last digit changed would scan as a different product.
  • It will not scan: keep the white margin, print it bigger, use black on white, and avoid shiny or curved surfaces. Test with a real scanner before printing many.
  • Only put an EAN-13 on goods for sale if GS1 issued you the number — a made-up one scans fine but may belong to someone else's product.

What this is

The check digit is the part worth understanding. The last digit of an EAN-13 or UPC-A is not data — it is computed from the twelve before it, and it exists so that a scanner can tell when one of them has been misread.

Which is why this page refuses a wrong one rather than fixing it. If the check digit does not match, some other digit is mistyped; silently replacing the last one gives you a barcode that scans perfectly and identifies a different product. That is the worst outcome available, and it is what a helpful tool would quietly hand you.

The first digit of an EAN-13 is not drawn. Look at the bars and you will find twelve digit symbols, not thirteen. The missing one is carried by which of two left-hand alphabets each of the first six digits uses — the parity pattern. It is why the symbol is 95 modules wide instead of 102, and why an EAN-13 cannot be read symbol by symbol from the left.

The white margin is part of the barcode. The quiet zone is nine modules on an EAN-13 and ten on the others, and a scanner needs it to find where the symbol begins. Cropping an image tight to the bars is the single commonest reason a generated barcode will not read, so the download here includes it.

One thing this cannot give you: a number. Retail codes are issued by GS1 and the prefix identifies the company that owns it. A made-up EAN will scan and may already belong to somebody else's product. For internal labels, use Code 128 — that number space is yours.

Questions

What is the check digit and why will it not let me type my own?

The last digit of an EAN-13 or UPC-A is computed from the others, and its whole purpose is to catch a mistyped digit. If the one you enter does not match, something else in the number is wrong — so this refuses the code rather than correcting the last digit for you. A "corrected" barcode is perfectly scannable and points at a different product, which is worse than no barcode at all. Enter twelve digits and it computes the thirteenth.

Why is the first digit of an EAN-13 not in the bars?

Because there is no room for it. There are only twelve digit symbols in the pattern. The thirteenth is carried by which of two left-hand alphabets each of the first six digits uses — the parity pattern. That is why an EAN-13 is 95 modules wide rather than the 102 a straight count suggests, and why you cannot read one symbol at a time from left to right.

Why does my barcode not scan?

Nine times out of ten, the quiet zone. The blank margin either side of the bars is part of the symbol, not decoration, and cropping an image tight to the bars removes it. The margin is included in the download here. The other common causes are printing it too small, printing it on a curved or shiny surface, and insufficient contrast — black on white, always.

Which symbology should I use?

EAN-13 or UPC-A if the item will be sold at retail, and only with a number issued to you by GS1 — a made-up one may already belong to somebody else. Code 128 for anything internal: it takes any printable ASCII and packs digits two to a symbol, so it is compact. Code 39 when you need something an old or simple reader will definitely handle, accepting that it is about a third wider.

Can I invent my own EAN-13 number?

You can generate one here, and you should not put it on anything for sale. Retail barcode numbers are issued by GS1 and the prefix identifies the company that owns it. A made-up number will scan happily and may collide with a real product somewhere in the world. For internal stock, labels and asset tags, use Code 128 instead — nobody owns that number space.

Do you check that these actually scan?

Not with a scanner, and it is worth being straight about it. Each symbology is verified structurally and by decoding the generated pattern back to the original value, which is a genuine check and catches most classes of error. The QR generator on this site was additionally compared against a reference encoder and read with a real camera; these have not been. Test with a physical reader before printing them on anything that matters.

The maths

The EAN-13 check digit
Weight the digits 1, 3, 1, 3 …from the left, twelve of them
Add them up5 + 27 + 0 + 3 + … for 590123412345
Take the total modulo 1083 → 3
Subtract from 10, modulo 10→ 7, the check digit

The alternating weights are what make it catch a transposition — two swapped digits change the total.

What each symbology costs
Encoding twenty digits
Code 39334 modules
Code 128, treated as text255 modules
Code 128, digits packed two per symbol145 modules

Code 128 has a numeric mode that carries two digits in the space of one character. It is used automatically here when a run of digits is long enough to pay for the switch.

Keep going

Important

Generated in your browser; nothing is transmitted. These symbologies are verified structurally and by decoding them back, which is not the same as testing with a scanner — check with a real reader before printing at scale. Retail barcode numbers must be issued by GS1. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.