Home › Generators & Text Tools › EAN Barcode Generator
EAN Barcode Generator
This free EAN Barcode Generator builds a scannable EAN-13 or UPC-A barcode from your number, works out the check digit for you — or checks the one you have — and lets you download the barcode as an SVG or PNG. Type 12 digits for EAN-13 and the 13th is calculated; type all 13 and the tool verifies them. The barcode is drawn in your browser by the open-source JsBarcode library, loaded from the jsDelivr CDN.
Drawing uses the JsBarcode library from the jsDelivr CDN; your number itself is processed only in your browser and is never uploaded. For selling real products in shops you need your own GS1 company prefix — see the FAQ.
How to use this tool
- Choose EAN-13 or UPC-A.
- Type your number: 12 digits (EAN) or 11 digits (UPC) and the tool adds the check digit — or type the full code and the tool validates it.
- Press Generate Barcode and check the preview; the full number and its check digit are shown under the bars.
- Download the SVG for print and design work, or the PNG for documents and web use.
How the check digit works
Every EAN and UPC ends in a check digit that is not chosen — it is calculated from the digits before it, so a scanner can spot a misread instantly. For EAN-13, take the first 12 digits and multiply them by weights that alternate 1, 3, 1, 3… starting with 1. Add the products, and the check digit is whatever makes the total a multiple of ten:
UPC-A uses the same idea with the weights swapped — 3, 1, 3, 1… — across its first 11 digits. That is the only real difference between the two systems: a UPC-A is exactly an EAN-13 with a quiet 0 in front, and the weight patterns line up so both give the same check digit. This tool does the arithmetic either way, and if you type a full code with a wrong final digit, it tells you what the last digit should have been instead of drawing a barcode that scanners would reject.
| Type | You type | Full length | Weights | Used in |
|---|---|---|---|---|
| EAN-13 | 12 digits | 13 | 1, 3, 1, 3… | Retail worldwide |
| UPC-A | 11 digits | 12 | 3, 1, 3, 1… | Retail in the USA and Canada |
| EAN-8 | 7 digits | 8 | 3, 1, 3, 1… | Very small packages |
About the bars themselves: the digits are encoded as patterns of black and white stripes of different widths, with guard bars at both ends and the middle so a scanner can read the code forwards, backwards or upside down. The human-readable digits printed under the bars are for people, not scanners — but they must match the bars, which is why this tool always shows the full number it drew.
Worked example
Take the classic test number 590123412345. Multiply by the EAN weights 1, 3, 1, 3… from the left: 5×1 + 9×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3 = 5 + 27 + 0 + 3 + 2 + 9 + 4 + 3 + 2 + 9 + 4 + 15 = 83. The check digit is (10 − 3) mod 10 = 7, so the complete, valid EAN-13 is 5901234123457 — exactly what the tool generates and draws. The same method on the UPC number 03600024000 (weights 3, 1, 3, 1…, sum 31) gives check digit 9, completing it as 036000240009.
FAQ
What is an EAN-13 barcode?
EAN-13 is the 13-digit barcode printed on almost every retail product outside North America. The first digits identify the GS1 country office that issued the number, the middle digits identify the company and the product, and the last digit is a check digit calculated from all the others. Shop scanners read the stripe pattern, recompute the check digit, and reject the scan if the two do not agree.
How is the EAN check digit calculated?
Take the first 12 digits and multiply them by alternating weights — 1, 3, 1, 3 and so on, starting with 1. Add up the products, then the check digit is the number that brings the total to the next multiple of ten: (10 − (sum mod 10)) mod 10. Example: 590123412345 gives a weighted sum of 83, so the check digit is 7 and the full code is 5901234123457. This generator does the maths for you and validates full codes too.
What is the difference between EAN-13 and UPC-A?
Very little. UPC-A is the 12-digit North American standard; EAN-13 is the 13-digit worldwide one. A UPC-A is really an EAN-13 with a leading zero, and the check-digit weights are arranged (3, 1, 3, 1… for UPC against 1, 3, 1, 3… for EAN) so that the same product number earns the same check digit in both systems. Most modern scanners read both.
Can I print these barcodes on products I sell?
For mock-ups, internal labels, prototypes and testing, yes. For real retail sale, the number inside the barcode must come from your own GS1 company prefix — the licensed block of numbers registered to your business. Barcodes built from made-up numbers can collide with another company's products and shops may refuse them. Get a prefix from your national GS1 office before printing retail packaging.
Which download should I use, SVG or PNG?
SVG is a vector file: it stays perfectly sharp at any size, so it is the right choice for packaging, print and design software. PNG is a pixel image (this tool renders it at three times display size), which suits documents, spreadsheets, web pages and quick prints. For scanning reliability, keep the printed barcode at least about 30 mm wide and on a flat, white background.
Is my barcode number uploaded anywhere?
No. The check digit and the barcode are worked out on your device. The only download is the open-source JsBarcode drawing library, fetched once from the jsDelivr content delivery network — your number is never sent to it or to us, and nothing is saved when you leave the page.