Barcode Generator

An EAN-13 barcode has 13 digits, the last one a check digit. For the body 400638133393 the check digit is 1, giving 4006381333931.

Did this solve your problem?
Prefer us on Google

How to use

  1. Pick a format: Code 128 for any text or ID, EAN-13 or UPC-A for retail product numbers.
  2. Type the value. For EAN-13 enter 12 digits and the check digit is added, or enter all 13 to have it checked. UPC-A works the same way with 11 or 12 digits.
  3. Download the barcode as SVG for print and design tools, or as PNG for documents and labels.

How it works

A barcode is a row of modules, narrow units that are either a bar or a space. Every format has start and end guard patterns and a quiet zone of blank space on both sides so scanners can find the edges. This tool adds 11 modules of quiet zone on each side.

Code 128 maps each character to a pattern of 3 bars and 3 spaces, 11 modules wide. If the value is only digits with an even length of 4 or more, it uses code set C, which packs two digits into one symbol. Otherwise it uses code set B, which covers printable ASCII from space to tilde. The check symbol is the start value plus each symbol value times its position, modulo 103, followed by the stop pattern.

EAN-13 encodes 12 digits plus a check digit. The first digit is not drawn as bars; it sets which of the next six digits use the L or G pattern. The right six digits use the R pattern. The check digit weights the digits 3 and 1 alternately starting from the right, and is whatever brings the total up to a multiple of 10. UPC-A is the same system with an implied leading 0, so a UPC-A barcode is identical to the EAN-13 barcode of 0 followed by the 12 digits.

Which format to use

FormatAcceptsTypical use
Code 128Any printable ASCII textShipping labels, asset tags, internal IDs
EAN-1312 digits plus check digitRetail products outside North America, books (ISBN)
UPC-A11 digits plus check digitRetail products in the US and Canada

Printing tips

  • Print dark bars on a light background. Reversed or low contrast colors often fail to scan.
  • Keep the blank space on both sides; trimming the quiet zone is a common cause of scan errors.
  • Do not stretch the barcode unevenly. Scale width and height together, or use the SVG.

FAQ

Can I use these barcodes on products I sell in stores?

The barcode itself will scan, but retail product numbers must come from GS1 or a licensed reseller. Making up an EAN or UPC number risks clashing with another company's product.

Why does it say my check digit is wrong?

The last digit of an EAN-13 or UPC-A number is calculated from the others. If it does not match, the number was probably mistyped. The tool shows the correct full number so you can compare.

SVG or PNG?

SVG is a vector file that stays sharp at any size, which is best for printing and design software. PNG is a regular image that works almost everywhere; it is exported at 3 times the screen size.

Is my data sent anywhere?

No. The barcode is drawn entirely in your browser and the value never leaves your device.