Barcode Generator — EAN, UPC, Code 128 & ITF
Generate retail and logistics barcodes with automatic check-digit calculation and print-ready SVG output.
1D & 2D Barcode Generator
Generate 1D and 2D barcodes. Everything runs locally — nothing is sent to any server.
Any ASCII text
Looking for a scannable QR code with custom colours and logo? Try the QR Code Generator →
Which symbology you need
| Symbology | Encodes | Length | Used for |
|---|---|---|---|
| EAN-13 | Digits | 12 + check digit | Retail products worldwide — the standard on almost everything sold in shops |
| EAN-8 | Digits | 7 + check digit | Small retail packaging where EAN-13 will not fit |
| UPC-A | Digits | 11 + check digit | Retail in the US and Canada. A subset of EAN-13 with a leading zero |
| UPC-E | Digits | 6 + check digit | Compressed UPC-A for very small packaging |
| Code 128 | All 128 ASCII characters | Variable | Logistics, shipping labels, internal tracking. The most flexible of these |
| Code 39 | A–Z, 0–9, a few symbols | Variable | Older industrial and military systems. Less dense than Code 128 |
| ITF-14 | Digits, in pairs | 13 + check digit | Shipping cartons and cases — prints reliably on corrugated cardboard |
For a retail product that will be sold through shops you need a genuine GS1-issued prefix, not just a well-formed barcode. Retailers verify the number resolves to your company in the GS1 registry. Made-up numbers scan fine and will be rejected at onboarding.
How the EAN-13 check digit is calculated
The final digit is computed from the first twelve. Enter twelve and it is calculated for you — enter thirteen with the wrong final digit and conforming scanners reject the symbol.
check = (10 − ((sum of odd positions + 3 × sum of even positions) mod 10)) mod 10
- odd positions
- Digits 1, 3, 5, 7, 9, 11 (1-indexed from the left)
- even positions
- Digits 2, 4, 6, 8, 10, 12 — these are weighted ×3
- mod 10
- The outer mod handles the case where the inner result is 0
Worked example
- First 12 digits
- 590123412345
- Odd sum (5+0+2+4+2+4)
- 17
- Even sum (9+1+3+1+3+5)
- 22 × 3 = 66
- Total
- 83
- 83 mod 10
- 3
- (10 − 3) mod 10
- 7
Full EAN-13: 5901234123457
UPC-A uses the same algorithm with the weighting reversed (odd positions ×3). This is why treating a UPC-A as a 12-digit EAN-13 by prefixing a zero works — the leading zero shifts every position by one and the weights line up.
Why a printed barcode will not scan
Scanner rejects a well-formed-looking number
Cause:The check digit does not match the preceding digits.
Fix:Enter only the data digits — 12 for EAN-13, 11 for UPC-A, 13 for ITF-14 — and let the generator compute the check digit.
Barcode scans inconsistently or only at certain angles
Cause:Insufficient quiet zone. The blank margin either side must be at least 10× the width of the narrowest bar; EAN-13 specifies 11 modules on the left and 7 on the right.
Fix:Leave generous white space. This is the most common print-time failure and it worsens as the code is scaled down.
Bars look blurred or merged in print
Cause:A raster image scaled up or printed below its native resolution. Barcode readability depends on crisp bar edges, and resampling destroys them.
Fix:Use SVG output for anything printed. Vector output stays sharp at any size, which is why it is the right default for labels.
Code scans on a phone but not on a retail scanner
Cause:Phone cameras are far more tolerant than laser scanners. Contrast, print quality and bar width tolerances that a phone forgives will fail a supermarket scanner.
Fix:Test on the target hardware. If it is for retail, ask the retailer for their verification requirements — many mandate a graded print-quality report.
Barcode printed on a curved or reflective surface fails
Cause:Curvature distorts bar widths; gloss creates specular reflection that blinds the scanner.
Fix:Orient bars parallel to the axis of curvature so widths are preserved, and use a matte label. On very small cylindrical items, consider a 2D code instead.
Code 128 output is longer than expected
Cause:Code 128 has three subsets (A, B, C). Subset C encodes two digits per symbol and is much denser, but only for pure digit strings of even length.
Fix:For an all-numeric value, ensure the length is even so subset C can be used throughout — an odd digit count forces a subset switch and costs several modules.
About
The Barcode Generator creates industry-standard 1D and 2D barcodes including Code 128, EAN-13, EAN-8, UPC-A, ISBN, ITF-14, QR Code, PDF417, Aztec, and DataMatrix. It supports customisation of size, margin, background colour, and line colour, and exports high-quality SVG or PNG files suitable for print or digital use. Need a scannable QR code with custom design and logo? Try the dedicated QR Code Generator.
How to use
- 1 Enter the data you want to encode in the input field.
- 2 Select the barcode format from the dropdown (1D formats like Code 128, or 2D formats like QR Code, PDF417).
- 3 Adjust size and colour settings if needed.
- 4 Click Download to save as SVG or PNG.
- Which barcode format should I use?
- Use Code 128 for general-purpose alphanumeric data (shipping labels, internal tracking). Use EAN-13 or UPC-A for retail products sold in stores. Use ISBN for books. Use QR Code, PDF417, or DataMatrix for higher-density 2D barcodes that need to encode more data in a compact space. QR codes are the most widely scanned 2D barcode format.
- What is the difference between a QR code and a barcode?
- Traditional barcodes (Code 128, EAN-13, UPC) are 1D — they encode data in a single row of lines. QR codes and other 2D barcodes (PDF417, DataMatrix) encode data in both dimensions, storing far more information in less space and remaining readable even when partially damaged. Both are generated by this tool.
- Can I download the barcode for printing?
- Yes. Barcodes can be downloaded as SVG (vector, infinitely scalable — ideal for print and labels) or PNG (raster, suitable for web and documents). For professional print use, always prefer SVG to avoid pixelation at large sizes.
- What data can I encode in a barcode?
- It depends on the format. Code 128 supports all 128 ASCII characters. EAN-13 and UPC-A encode numbers only (13 and 12 digits respectively). ISBN encodes 10 or 13-digit book identifiers. QR codes, PDF417, and DataMatrix support alphanumeric data, binary data, and extended character sets at higher density.