EAN-13 Barcode Generator
EAN-13 is the retail barcode of the world outside North America — thirteen digits, the last of which is a check digit that scanners use to catch misreads. Enter 12 digits and this tool computes the check digit for you (and says so); enter all 13 and it verifies the one you typed. Below the generator, a live breakdown shows what each digit of your number means. Wherever this page says a number is valid, it means structurally valid — right length, right characters, check digit consistent — which is a property of arithmetic, not a license.
What each digit means — live breakdown
Type or paste any 12- or 13-digit number — from the generator above, a product in your hand, or a spreadsheet — and see it segmented. Runs locally; nothing is transmitted.
12 digits shows the check digit to append; 13 digits verifies the one you have. Spaces and hyphens are ignored.
- GS1 prefix 400 — identifies the GS1 member organization that issued the company prefix, not the country of manufacture.
- Manufacturer + product 638133393 — the licensed company prefix followed by the item reference. Where one ends and the other begins depends on the license length, so it cannot be read off the number itself.
- Check digit 1 — matches the twelve digits before it.
4006381333931 is structurally valid: check digit 1 matches its first twelve digits.
How thirteen digits fit into a twelve-digit symbol
An EAN-13 symbol is exactly 95 modules wide — a module being the width of its thinnest bar. A three-module guard pattern at each end and a five-module guard in the center frame two halves of six digits each, every digit occupying seven modules. Count that up and only twelve digits get bars of their own.
The thirteenth — the leading digit — is carried by a trick: the left-half digits can each be drawn from two different encoding alphabets, and the pattern of which alphabet is used across those six positions spells out the leading digit. Leading digit 0 uses a single alphabet throughout, which is why a UPC-A is literally an EAN-13 with a leading zero: same bars, same check digit. The right half uses a third alphabet, so a scanner always knows which half it entered first — EAN-13 scans upside down as reliably as right side up. The leading digit, having no bars, is printed to the left of the symbol inside the left quiet zone — the wider of the two margins. For the digits themselves, the breakdown panel above does the honest split: GS1 prefix, manufacturer + product region, check digit — and our 13-digit barcode explainer covers the numbering system in more depth.
Go deeper: EAN-13 structure explained takes that panel's engine apart, and its companion, how GTIN check digits are computed, works the arithmetic below on a fictional number as well as the cited one. The guides hub has the rest.
How the check digit works
Number the first twelve digits left to right and multiply them alternately by 1 and 3 (the second, fourth, sixth… digits get the 3). Sum the products; the check digit is whatever brings that sum up to the next multiple of ten.
Worked example — data digits 400638133393:
Check digit: 1 → complete EAN-13: 4006381333931
This figure is computed at build time by the same tested algorithm the generator runs in your browser, so the page cannot drift from the code.
The same sum, position by position
The table is the engine's own intermediate output for the cited vector, every figure interpolated. Weights anchor at the right — the digit just before the check digit always carries 3 — so the 3 lands on the even positions.
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Digit | 4 | 0 | 0 | 6 | 3 | 8 | 1 | 3 | 3 | 3 | 9 | 3 |
| Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 4 | 0 | 0 | 18 | 3 | 24 | 1 | 9 | 3 | 9 | 9 | 9 |
The products sum to 89; the next multiple of ten is 90; and 90 − 89 = 1, the digit the generator appends. A sum already ending in zero gets 0, not 10 — the difference is taken modulo ten.
The check digit catches every single-digit typo and most adjacent-digit swaps — that is its whole job. It is why this tool never silently replaces a wrong 13th digit: a mismatch usually means one of the other twelve digits is wrong, and "correcting" the check digit would turn a detectable error into a perfectly valid wrong number. To work the algorithm by hand on any GTIN length, use the check digit calculator.
Compute mode and verify mode: reading the note
The validator reads the mode off the digit count. It normalises first — spaces and hyphens are
stripped, so the cited vector pasted as 400 6381-33393 1 becomes
4006381333931 — then enforces the length rule: 12 digits means compute, 13
means verify, any other count is refused with the count you entered. Last it reports what it did
beneath the barcode, in its own words; read that note before you download:
- Twelve digits in — "You entered 12 digits — the check digit 1 was computed and appended, making 4006381333931."
- Thirteen digits in — "You entered all 13 digits — the check digit 1 was verified against the first 12 and is correct." — the only note that says anything about the number you were handed.
Anything outside those two lengths is refused before any arithmetic runs, and the message
names the rule. GS1's published example GTIN-14, 09506000134352 — the carton code the
ITF-14 generator uses as its example — pasted here produces: "A EAN-13 needs 12 digits (check digit computed) or 13 digits (check digit verified) — you entered 14." The cited X-check ISBN-10 0-8044-2957-X fails the character rule instead, because
the X survives separator stripping: "A EAN-13 contains digits 0–9 only (spaces and hyphens are ignored)." The
ISBN barcode generator understands that X and converts the number to
its EAN-13 form.
What a mismatch looks like
A fictional corruption of the cited vector: position 5, a 3, becomes 5, giving 4006581333931 with the check digit untouched.
The verifier recomputes from the first twelve and compares — expected 9, supplied 1 — so the number is invalid. In the generator that is an
error, and no bars are requested:
"Check digit mismatch: for 400658133393 the final digit must be 9, but you entered 1. Fix the number, or enter only the first 12 digits to have the check digit computed."
Engine output, computed at build time from the corrupted input above.
The message names the required digit but never puts it in for you — 400658133393
followed by 9 would be a structurally valid number for the wrong item
— so it offers only the honest options: fix the number, or hand over twelve digits to compute from.
Swapping two adjacent digits moves the 3-weight onto one and the 1-weight onto the other, so
the sum changes by twice their difference. Swap positions 4 and 5 of the cited vector (6 and 3) and 4003681333931 is caught — expected 7, supplied 1. Swap positions 5 and 6
(3 and 8, which differ by 5) and 4006831333931 still verifies: twice 5 is 10, so the sum's last digit does not
move. That is what "most adjacent swaps" means: strong evidence of a clean transcription, not
proof.
The same twelve digits, read by the bulk validator
On this page twelve digits always mean "compute the thirteenth". The
check digit calculator, which validates a pasted column
of mixed GTIN lengths, cannot assume that: a twelve-digit line may be EAN-13 data awaiting its
check digit, or a complete GTIN-12 — a UPC-A — with its check digit already
in place. Its auto mode resolves the ambiguity openly in favour of the complete-number reading,
because it is a validator first. Paste the cited data digits 400638133393 there and auto
mode reads them as a GTIN-12, verifying the final 3 against the
eleven before it: "Check digit should be 0, not 3." — the corrected
400638133390 offered in a separate field, the line itself left alone. In
data-only mode the same line is GTIN-13 data: "Check digit 1 appended." completing
4006381333931, the number this generator produces. Neither reading is
wrong; they answer different questions, which is why the mode is a visible switch rather than
a guess.
Bulk GTIN validation modes covers the statuses
and the row cap.
Print-exact dimensions, from the GS1 specification
These figures come from the GS1 General Specifications (the standard behind GS1's EAN/UPC symbology page), as published by GS1 member organizations — the GS1 Sweden size guide and GS1 Ireland's EAN-13 specification:
| Property | At 100% magnification | Allowed (80–200%) |
|---|---|---|
| Module width (X-dimension) | 0.330 mm | 0.264 – 0.660 mm |
| Symbol incl. quiet zones | 37.29 × 25.93 mm | scales linearly with magnification |
| Bar height | 22.85 mm | 18.28 – 45.70 mm |
| Left quiet zone | 11 modules (3.63 mm) | always ≥ 11 × module width |
| Right quiet zone | 7 modules (2.31 mm) | always ≥ 7 × module width |
37.29 mm is not an arbitrary number: 95 modules of bars plus 11 + 7 modules of quiet zone make 113 modules, and 113 × 0.330 mm = 37.29 mm. The downloaded SVG is deliberately a little wider: the leading digit is printed in a blank 12-module strip inside the left margin, so the file spans exactly 125 module widths, with more than double the minimum quiet zone on the left. That makes the print math exact — set the SVG's width to 41.25 mm (125 × 0.330 mm) and every module comes out at precisely 0.330 mm; any width from 33.00 mm (80%) to 82.50 mm (200%) stays inside the allowed magnification band. Scale width and height together, always.
Quiet zones die in Word documents because white margins look like wasted space: the image gets cropped tight, or text and table borders crowd against its edges, and a scanner can no longer find where the symbol begins. The margins are part of the barcode — keep the ones that ship inside the download.
Verified before you download it
Every barcode this page shows has passed three checks, and it is worth being precise about what they do and do not cover. First, structure: the input must be exactly 12 or 13 digits, nothing else. Second, the check digit: computed for you or verified against what you typed, with mismatches flagged, never repaired. Both checks happen before the drawing library receives the accepted payload, using this site's separately implemented and tested arithmetic. Third, the actual SVG is rasterized and decoded by ZXing, independently from JsBarcode; an unreadable or mismatched render is withheld. The PNG canvas is decoded separately before export. These checks cover generated files, not physical print quality. The methodology page documents the full boundary.
The SVG that verification protects is free — worth saying plainly, because vector export is a common paywall on barcode sites. What none of this can verify is print quality: ISO/IEC 15416 grades a printed symbol on contrast, defects, and decodability, and those depend on your printer, ink, and substrate. We check the math; only a verifier or a real scanner can check the optics — test the printed result before production.
A withheld barcode is reported under one of 2 reasons, each named in the generator:
-
decode-failed— the bars could not be read. -
payload-mismatch— a different string was read.
One equivalence is accepted deliberately: an EAN-13 payload beginning with 0 is the same
printed symbol as the 12-digit UPC-A without that zero. Take the cited UPC-A reference
vector's data digits with a leading zero, 003600029145, whose EAN-13 form is
0036000291452: a reading of 036000291452 for it is correct.
For the cited EAN-13 4006381333931, by contrast, a fictional misreading that drops the
first digit, 006381333931, withholds the download. See
how the verifier decodes what you see.
What the ZPL download carries
The ZPL option in the download menu is a text document of printer commands, not an image; the
printer's own barcode engine draws the bars from it. The export insists on the full validated
payload — handed the twelve data digits alone it refuses: “EAN-13 ZPL export needs the full 13-digit payload including the check digit, exactly as the generator produced it — received "400638133393" (12 characters).” Given
4006381333931 it verifies the check digit once more, then sends only the data digits,
^FD400638133393^FS, because the printer recomputes the thirteenth itself; the export's
own note says so: “The ^FD data carries only the data digits — the printer recomputes the check digit and arrives at the same 1 for this EAN-13 that our validator already verified.” The rest of the document, and the EPS export's unit mapping,
are explained in ZPL and EPS export explained.
EAN-13, GTIN-13, and the rest of the family
The number inside an EAN-13 symbol is a GTIN-13 — one member of the GTIN family this site's 13-digit barcode guide maps out. The same mod-10 arithmetic protects UPC-A (a 12-digit GTIN — a UPC-A with a leading zero is the EAN-13 form of the same number), ITF-14 carton codes (GTIN-14), and the Bookland EAN that carries ISBNs with a 978/979 prefix — the breakdown panel above recognizes those prefixes when you paste a book's number. And if you are still deciding whether your product needs a licensed number at all, start with Do I need a GS1 barcode? For items sold only inside your own store — deli counters, store-packed goods, internal SKUs — the in-store barcode guide explains the restricted-circulation prefixes built for exactly that.
EAN-13 FAQ
What do the 13 digits of an EAN-13 mean?
Three segments. The first three digits are the GS1 prefix, identifying the GS1 member organization that issued the company prefix. The middle nine hold the licensed company prefix followed by the item reference — the split between those two varies with the license, so it cannot be read off the number. The last digit is a check digit computed from the other twelve.
Do I enter 12 digits or 13?
Either. With 12 digits the tool computes the 13th (the check digit) and tells you it did. With 13 digits the tool verifies the last one against the first twelve and flags any mismatch instead of silently accepting or "fixing" it.
Why does the tool say my 13th digit should be different?
Because the check digit you entered does not match the one the first twelve digits require under the GS1 mod-10 algorithm. The tool shows the digit that would make the number structurally valid, but it never applies the fix automatically: a mismatch more often means one of the other twelve digits is mistyped, and quietly correcting the last digit would convert a detectable error into a perfectly valid wrong number.
Can I use this barcode to sell on Amazon?
Not with an invented number. Amazon validates GTINs against the GS1 registry, and listings with numbers that fail that check can be blocked or removed — the same applies at Walmart and most large retailers. You need a GTIN allocated under a GS1 license, and then this tool can render it. If your product genuinely has no GTIN, apply for a GTIN exemption in Amazon Seller Central rather than generating a number.
What size should I print an EAN-13?
The nominal (100%) symbol is 37.29 × 25.93 mm with a module width of 0.330 mm, and GS1 allows 80% to 200% of that — modules from 0.264 to 0.660 mm, bar height from about 18.28 to 45.70 mm. Keep the quiet zones (11 modules left, 7 right) and never scale width and height separately.
Does the first digit tell me where a product was made?
No — a common myth. The leading digits identify the GS1 member organization that issued the company prefix, which is where the company registered, not where any product was manufactured.
Is the SVG download really free?
Yes — free, without a watermark, and without an account. SVG is a vector format, so it rescales to any print size without redrawing pixels, which is exactly what a print-bound barcode needs.
Is anything I type sent anywhere?
No. Validation, check-digit math, the digit breakdown, and rendering all run as JavaScript in your browser. Nothing is transmitted, logged, or stored; closing the page discards it.
Verify before production: this tool checks the math, not the optics — always test the printed result with your own scanner. Everything runs locally in your browser. See the methodology page for how the verification layer works.