GENERATOR

Barcode Generator

Create UPC-A, EAN-13, EAN-8, Code 128, Code 39 and ITF-14 barcodes with automatic check digits, then download a print-ready SVG or PNG.

About this tool

This free barcode generator makes printable linear barcodes in six common formats: Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14. It checks your data against the rules of the chosen format, calculates or verifies the check digit for the GS1 number formats, and lets you download the result as a scalable SVG or a PNG image. The barcode is drawn in your browser with the open-source JsBarcode library, so nothing you type is uploaded.

How to use the barcode generator

  1. Choose a format. Use UPC-A or EAN-13 for a retail product number you already own, Code 128 for general text and internal labels, and ITF-14 for a case-level GTIN.
  2. Enter the data. For UPC-A, EAN-13, EAN-8 and ITF-14 you can leave off the last digit and the tool adds the check digit, or type the full number and it checks that the last digit is right. Spaces and hyphens in numbers are removed.
  3. Set the size. Bar width is the width of the narrowest bar in pixels, height is the bar height, and margin is the blank space on each side measured in bar widths. The default of 11 bar widths covers the minimum quiet zones listed further down.
  4. Download. SVG is a vector file that stays sharp at any size and suits print layouts. PNG is a bitmap for documents and web pages; pick 2x to 4x for a sharper image.

Which barcode format should you use?

FormatData it holdsCheck digitTypical use
UPC-A12 digitsGS1 mod 10 (last digit)Retail products, mainly in the US and Canada
EAN-1313 digitsGS1 mod 10 (last digit)Retail products, the same settings as UPC
EAN-88 digitsGS1 mod 10 (last digit)Small packs where UPC-A or EAN-13 will not fit
ITF-1414 digitsGS1 mod 10 (last digit)Cases and cartons not scanned at checkout
Code 128All 128 ASCII characters (this tool accepts printable ones, up to 80)Mod 103, built in and hiddenShipping, inventory and asset labels
Code 3943 characters: 0-9, A-Z, space and - . $ / + %Optional mod 43Older industrial and internal labels

The retail uses above follow GS1 US's guide to barcode types. Code 128 is specified in ISO/IEC 15417 and Code 39 in ISO/IEC 16388. Code 39 has no lowercase letters, so this tool converts lowercase input to capitals.

A barcode image is not a product number

Any 12 digits with a correct check digit will produce a UPC-A barcode that scans. That does not make it a valid product number. The numbers inside UPC and EAN barcodes are GTINs (Global Trade Item Numbers), managed by GS1, the not-for-profit standards body behind these formats. Brand owners get them by licensing a GS1 Company Prefix or individual GTINs from their local GS1 office, which in the United States is GS1 US. GS1 US notes that each variation of each product you sell requires a unique barcode. If you sell through retailers or online marketplaces, get your numbers from GS1 first, then use this tool or any other generator to draw the bars. For internal labels such as inventory, asset tags or library items, Code 128 or Code 39 with your own numbering needs no license.

Worked example: the check digit

The sample input is the 12-digit number 629104150021, the same example GS1 uses in its guide to calculating a check digit manually. Starting from the rightmost digit and moving left, the digits are multiplied by 3, 1, 3, 1 and so on, and the products are added:

Digit629104150021
Weight131313131313
Product66930121150023

The products add up to 57. The next multiple of ten at or above 57 is 60, and 60 − 57 = 3, so the check digit is 3 and the full EAN-13 is 6291041500213. That is what the tool shows when the page loads. The same rule, weights 3 and 1 counted from the right, gives the check digit for UPC-A, EAN-8 and ITF-14. Because the weights are 3 and 1, changing any single digit always changes the check digit, which is how scanners and checkout systems catch a misread or mistyped number.

Printing tips

Common mistakes

Use cases

Need to encode a web address or longer text? A 2D code holds far more data; use the QR Code Generator, and the QR Code Scanner to read one back. For random IDs to put in a Code 128 barcode, try the UUID Generator or the Random Number Generator.

Frequently asked questions

Are barcodes made with this generator free to use?

Yes. The images you download are yours to use on labels, packaging and documents without attribution. What is not free is a retail product number: if a store or marketplace needs a UPC or EAN, the number itself should come from GS1, and you then turn it into a barcode here or anywhere else.

What is the difference between UPC-A and EAN-13?

Both encode a GTIN and scan at checkout. UPC-A holds 12 digits and is the usual format in the United States and Canada. EAN-13 holds 13 digits and is used in most other countries. A 12-digit UPC can be written as an EAN-13 by adding a 0 at the front.

Can I use any 12-digit number as a UPC?

You can generate a barcode from any 12 digits with a valid check digit, and it will scan. But a retailer looks the number up in its product catalog, and a made-up number is not assigned to your company and may already belong to someone else. Use a number licensed from GS1 for anything sold in stores.

Which format should I use for inventory or asset tags?

Code 128 is the usual choice. It accepts letters, digits and punctuation, is compact, and has a built-in check character. Code 39 is also widely readable but only supports capitals, digits and a few symbols, and it produces a wider barcode for the same data.

Why does the tool say my check digit is wrong?

For UPC-A, EAN-13, EAN-8 and ITF-14, the last digit is calculated from the others. If you type a full-length number and the last digit does not match, there is probably a typo. Check the number against the original, or leave off the last digit and the tool will calculate it.

Should I download SVG or PNG?

Use SVG for print and packaging, because it is a vector file that stays sharp at any size in design and layout apps. Use PNG for documents, spreadsheets, websites and label software that only accepts images, and choose a 2x to 4x scale so it stays crisp.