Barcode Generator

Make EAN-13, UPC-A, EAN-8, Code 128, Code 39, ITF-14 and Interleaved 2 of 5 barcodes with check digits added or verified, and download them as SVG or PNG.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Barcode Generator?

Pick a symbology, type the number or text, and the barcode is drawn straight away. For EAN-13, UPC-A, EAN-8 and ITF-14 you can type the code without its last digit and the GS1 check digit is calculated for you; if you type the full code, the check digit is verified and a wrong one is caught with the correct value shown.

Download the result as an SVG for print and packaging artwork, where it scales without blurring, or as a PNG drawn at four times the screen size for documents and labels. Bar width, height, colours and the human-readable text underneath are adjustable. A separate check digit calculator works on any GTIN-8, 12, 13 or 14 number.

Bars are drawn in your browser by the open-source JsBarcode library. Nothing is uploaded, so you can generate barcodes for internal asset tags or unreleased products without sharing the numbers.

  • EAN-13, UPC-A, EAN-8, ITF-14, Code 128, Code 39 and Interleaved 2 of 5
  • GS1 check digit added or verified with the correct digit shown
  • Code 39 optional mod 43 check character
  • SVG and 4x PNG download, custom colours and size
  • Standalone GTIN check digit calculator
  • Runs in the browser with JsBarcode, nothing uploaded
Read the guide: Barcode Types and Check Digits: EAN, UPC, Code 128 and More

How to use the Barcode Generator

  1. Choose the format. Use EAN-13 or UPC-A for retail products, ITF-14 for cartons, Code 128 for text such as order numbers, Code 39 for systems that require it.
  2. Type the value. For GS1 formats leave off the check digit to have it added, or type all digits to have it checked.
  3. Adjust the bar width and height. Wider bars scan from further away; keep dark bars on a light background.
  4. Download SVG for print artwork or the 4x PNG for documents, labels and web pages.
  5. Use the check digit calculator to verify a number from a supplier or a product database before you print.

Worked examples

EAN-13 from 12 digits

Input

EAN-13, 400638133393

Output

4006381333931 (check digit 1 added)

From the right: 3x3 + 9x1 + 3x3 + 3x1 + 3x3 + 1x1 + 8x3 + 3x1 + 6x3 + 0x1 + 0x3 + 4x1 = 89. The next multiple of 10 is 90, so the check digit is 1.

Catching a typo in a UPC-A

Input

UPC-A, 036000291459

Output

Error: check digit should be 2 (036000291452)

The last digit does not match the first eleven, so the code would be rejected at a till. The correct code is shown.

Shipping reference in Code 128

Input

Code 128, RB-2026-0042

Output

Scannable barcode with automatic check symbol

Mixed letters, digits and hyphens are fine in Code 128. The modulo-103 check is added by the encoder, not typed by you.

Odd length in Interleaved 2 of 5

Input

ITF, 12345

Output

Error: needs an even number of digits; try 012345

ITF pairs digits into bars and spaces, so a leading zero is the standard fix.

Background and insight

Retail barcodes carry a GTIN (Global Trade Item Number) allocated under a GS1 Company Prefix. EAN-13 is used worldwide, UPC-A (12 digits) mainly in the United States and Canada, and a UPC-A is the same number as an EAN-13 that starts with 0. EAN-8 exists for packs too small for 13 digits. ITF-14 encodes a 14-digit GTIN on outer cartons and survives printing on corrugated board. The first product scanned at a checkout with a UPC was a pack of chewing gum in Troy, Ohio, in June 1974.

All these GS1 numbers end in a mod-10 check digit. Starting from the rightmost data digit, multiply digits alternately by 3 and 1, add the products, and the check digit is the amount needed to reach the next multiple of 10. For 400638133393: the weighted sum is 89, so the check digit is 1 and the full EAN-13 is 4006381333931. The check catches every single-digit error and most swaps of neighbouring digits, which is why a scanner rejects a misprinted code instead of ringing up the wrong product.

Code 128 and Code 39 are general-purpose symbologies for text. Code 128 encodes all 128 ASCII characters and always includes a modulo-103 check symbol; it is compact and is the basis of GS1-128 shipping labels. Code 39, created at Intermec in 1974, encodes 43 characters (A to Z, 0 to 9, space and - . $ / + %), needs no check character, and is wider but very tolerant of poor printers, which is why it survives on badges and in automotive and defence labelling. Interleaved 2 of 5 encodes digits in pairs, so the count must be even.

Common use cases

  • Product packaging

    Produce EAN-13 or UPC-A artwork for a GTIN you have been allocated by GS1.

  • Warehouse and cartons

    Print ITF-14 codes for outer cases and Code 128 for bin and pallet labels.

  • Asset tags and inventory

    Label laptops, tools and library items with Code 128 or Code 39 serial numbers.

  • Checking supplier data

    Verify check digits in a product feed before importing it into a shop or marketplace.

  • Event tickets and badges

    Encode a booking reference or staff ID that a handheld scanner can read.

Tips and limitations

  • A barcode image is not a product number. To sell through most retailers and marketplaces you need GTINs from GS1 (or one of its licensed resellers where allowed); making up numbers risks clashing with another company's products.
  • Leave white space (the quiet zone) on both sides. EAN-13 needs about 11 module widths on the left and 7 on the right; do not let artwork or a box edge touch the bars.
  • Print size matters. GS1 specifies EAN-13 with a nominal 0.33 mm module at 100% magnification and allows roughly 80% to 200%. Shrinking below that or cutting the height makes scanning unreliable.
  • Use SVG for print. A PNG scaled up in a layout program gets blurred bar edges, which hurts scan rates on thermal and inkjet printers.
  • Red bars are invisible to most laser scanners, which use red light. Stick to black or dark blue bars on white or light backgrounds.

Frequently asked questions

How is an EAN-13 or UPC check digit calculated?

Starting from the rightmost data digit, multiply digits alternately by 3 and 1 and add them up. The check digit is what you add to reach the next multiple of 10. For 400638133393 the sum is 89, so the check digit is 1.

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

UPC-A has 12 digits and EAN-13 has 13. A UPC-A is the same as an EAN-13 with a leading 0, so modern scanners read both. UPC-A is still common in the US and Canada; EAN-13 is used everywhere else.

Can I make up my own EAN or UPC numbers?

You can draw any number, but retail and marketplace systems expect GTINs licensed from GS1. A made-up number may belong to another company and can get listings removed. Internal codes are safer in Code 128.

Should I use Code 128 or Code 39?

Code 128 is more compact and encodes all ASCII text with a built-in check. Code 39 is wider and limited to uppercase letters, digits and a few symbols, but older systems and some industries still require it.

What size should a printed barcode be?

For EAN-13 and UPC-A, GS1 sets a nominal module of 0.33 mm at 100% and allows about 80% to 200%. Keep the full height and the white quiet zones. Use the SVG so the bars stay sharp at any size.

Why does my ITF barcode need an even number of digits?

Interleaved 2 of 5 encodes two digits at a time, one in the bars and one in the spaces. Add a leading zero to an odd-length number.

Are my barcode values sent to a server?

No. JsBarcode draws the bars in your browser and the downloads are created locally.

Is there an in-depth guide to the Barcode Generator?

Yes. “Barcode Types and Check Digits: EAN, UPC, Code 128 and More” covers the background, how it works, common pitfalls and worked examples. Read the full guide.

People also search for

  • ean 13 check digit calculator
  • upc a barcode generator svg
  • code 128 barcode for shipping label
  • code 39 vs code 128 difference
  • itf 14 barcode for cartons
  • do i need a gs1 barcode to sell on amazon
  • barcode png high resolution for print
  • how is a upc check digit calculated