SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call

How to make a barcode

By Taimur Hassan SiddiquiPublished 7 October 2026

A barcode encodes digits or text as bars a scanner can read. This guide explains which type to choose for inventory labels or retail products, how the check digit is calculated, and how to print a code that scans reliably.

The short version

  1. Choose the type: Code 128 for your own labels, EAN-13 or UPC-A for retail products.
  2. Enter the data. Text for Code 128; 12 digits for EAN-13 or 11 for UPC-A.
  3. Check the result including the calculated check digit.
  4. Download and print as SVG for sharp print, then test-scan it.

Skip the arithmetic. The free Barcode Generator does this for you, shows the formula and the working with your own numbers, and runs in your browser - nothing you type is uploaded. Also useful: Case Converter.

Open the Barcode Generator →

Which barcode for which job

TypeEncodesUse for
Code 128Letters, digits and symbolsInventory, asset tags, order and shipping references
EAN-1313 digitsRetail products outside the US and Canada
UPC-A12 digitsRetail products in the US and Canada

Retail numbers must come from GS1, the organisation that issues company prefixes. You cannot invent EAN or UPC numbers for products you sell through retailers or marketplaces. For your own stock and internal labels, Code 128 needs no registration.

How the check digit works

The last digit of an EAN-13 is calculated from the first 12 so a scanner can detect misreads. Multiply the digits alternately by 1 and 3 from the left, add them, and the check digit is whatever brings the total up to the next multiple of 10.

4 0 0 6 3 8 1 3 3 3 9 3 weights: 1 3 1 3 1 3 1 3 1 3 1 3 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89 check digit = 90 − 89 = 1 → 4006381333931

Printing so it scans

  • Keep the quiet zone, the blank margin on each side. It is part of the symbol.
  • Dark bars on a light background. Black on white is safest; red bars can be invisible to some scanners.
  • Do not squash it. Scale width and height together, and use SVG or a large PNG for print.
  • Test before you print a batch. Scan a sample with the scanner or phone app you will use.

Barcode or QR code?

A barcode (1D) holds a short code that a database looks up, such as a product or order number. A QR code (2D) can hold a web address or much more text and works from many angles. Use a barcode for inventory and retail scanners and a QR code for links.

Frequently asked questions

Can I make my own EAN or UPC number?
Not for selling through retailers. You need a number licensed from GS1. A generator only draws the barcode for a number you already have.
What is the difference between a barcode and a QR code?
A barcode is one-dimensional and stores a short code; a QR code is two-dimensional and stores more, such as web links.
What is a check digit for?
It lets a scanner detect a misread, since the digits must satisfy the formula.
Why will my barcode not scan?
Common causes are a missing quiet zone, low contrast, printing too small, a damaged print or the wrong barcode type for the scanner.
SVG or PNG?
SVG for print because it stays sharp at any size; PNG for documents and screens.