Social media growth services from EthicalSMM

Barcode Generator

Make Code 128, EAN-13, UPC-A or EAN-8 barcodes with the check digit worked out for you, then download them as PNG or print-ready SVG.

Was this tool helpful?

Thanks for the feedback!

This barcode generator makes Code 128, EAN-13, UPC-A and EAN-8 barcodes in your browser and downloads them as PNG or SVG. For EAN and UPC it works out the GS1 check digit for you, or checks the one you typed. It is for shop owners preparing product labels, small businesses tagging stock or office assets, and anyone who needs a scannable code for a reference number.

How to make a barcode

  1. Choose the Barcode type: Code 128 (text), EAN-13 (retail, India 890), UPC-A (US retail) or EAN-8 (small packs).
  2. Type the value. For Code 128 the box is labelled Text or number. EAN-13 asks for 12 digits (or 13 with check digit), UPC-A for 11 (or 12) and EAN-8 for 7 (or 8). Spaces and hyphens in EAN and UPC numbers are ignored.
  3. Set the Bar width (1 to 5 px per module, the narrowest bar) and Height (40 to 200 px). Untick Show number under bars if you want bars only.
  4. The preview updates as you type. The line under it shows the type, the check digit, the full number and the image size in pixels.
  5. Press Download PNG, drawn at twice the preview size, or Download SVG (for print).

If you switch type and your value does not fit the new format, the box is filled with a sample instead, such as 890123456789 for EAN-13. The samples are for trying the tool only.

The GS1 check digit, worked out

The last digit of every EAN and UPC number is a check digit that lets a scanner catch a misread. To find it, start from the rightmost data digit, multiply the digits alternately by 3 and 1, add the results, and take the amount needed to reach the next multiple of 10.

Take the EAN-13 sample 890123456789. Reading from the right, the digits 9, 7, 5, 3, 1 and 9 get weight 3, and 8, 6, 4, 2, 0 and 8 get weight 1.

  • Weight 3: (9 + 7 + 5 + 3 + 1 + 9) × 3 = 34 × 3 = 102
  • Weight 1: 8 + 6 + 4 + 2 + 0 + 8 = 28
  • Total 130. That is already a multiple of 10, so the check digit is 0 and the full number is 8901234567890.

A second example is the textbook EAN-13 number 4006381333931. Its first twelve digits total 89, the next multiple of 10 is 90, so the check digit is 1. The same rule gives the UPC-A example 03600029145 a check digit of 2 (036000291452) and the EAN-8 example 9638507 a check digit of 4 (96385074).

If you type the full number and the last digit is wrong, the tool tells you, for example "The last digit should be 1, not 2." for 4006381333932. A wrong length gets a message such as "EAN-13 needs 12 digits (the check digit is added for you) or 13 digits including the check digit. You entered 5."

You need GS1 numbers to sell in shops

A barcode image is only a picture of a number. Drawing the picture is easy; the number is what counts. Supermarkets, retail chains and most online marketplaces expect EAN-13 or UPC-A numbers that are licensed to your company by GS1. In India that is GS1 India, whose numbers start with 890. Do not make up an 890 number, copy one from another product, or put this tool's sample on goods for sale: the number may belong to someone else, and stores can reject the product. Once GS1 has given you your numbers, this tool can turn each one into a print-ready barcode.

Code 128 needs no registration. Use it for your own stock codes, asset tags on office laptops, library or file numbers, courier and order references, and event passes. It holds up to 80 characters here: letters, digits, spaces and keyboard punctuation. A symbol such as ₹ is refused with a message asking you to remove it.

Code 128 details and printing tips

  • Text is encoded in Code 128 set B. A value made only of digits, with an even count of at least 4, uses set C, which packs two digits into each symbol. So 123456 is 68 modules wide, while the odd-length 12345 falls back to set B and is 90 modules wide.
  • Code 128 carries its own check value: the start value plus each symbol's value times its position, divided by 103, keeping the remainder. For 123456 that is 105 + 12×1 + 34×2 + 56×3 = 353, remainder 44. Scanners use it silently and it is not printed under the bars.
  • Quiet zones, the blank margins a scanner needs, are built in: 10 modules either side of Code 128, 11 for EAN-13, 9 for UPC-A and 7 for EAN-8. Do not crop them off.
  • For labels and packaging, use the SVG, which stays sharp at any size. The standard EAN-13 module is 0.33 mm, so the 95 modules of bars measure 31.35 mm at normal size. Print black on white and test-scan a printout before ordering a batch of labels.
  • For a website link or a payment request rather than a product number, a QR code is the better choice.

Frequently asked questions

How do I calculate the check digit of an EAN-13 barcode?
Multiply the 12 digits alternately by 1 and 3 starting from the left, so the rightmost gets 3, add them up and take the amount needed to reach the next multiple of 10. For 400638133393 the total is 89, so the check digit is 1.
Can I use a free barcode generator for products sold in shops?
You can use it to draw the barcode, but the EAN or UPC number itself must be licensed to your business by GS1, which means GS1 India for 890 numbers. A made-up number can clash with another product and be rejected by retailers.
What does 890 at the start of a barcode mean?
It is the prefix range that GS1 India allocates to companies, so the number was issued through GS1 India. It does not by itself prove the product was made in India.
What is the difference between EAN-13 and UPC-A?
UPC-A has 12 digits and is used mainly in the US and Canada, while EAN-13 has 13 digits and is used in India and most other countries. A UPC-A number is the same as an EAN-13 with a leading 0, and the bars are identical.
Which barcode type is best for inventory or asset labels?
Code 128, because it holds letters, digits and punctuation and needs no registration. Short codes such as LAP-0142 keep the barcode narrow and easy to scan.
Should I download my barcode as PNG or SVG?
Choose SVG for labels and packaging, since it scales to any size without blurring. The PNG, drawn at twice the preview size, is fine for documents, spreadsheets and screens.

Related guides

Related tools

People also used

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.