How to use it
- Choose the barcode type. Use Code 128 for your own labels and IDs. Use EAN-13, UPC-A or ITF-14 only if a retailer or shipper asks for that type.
- Enter the value. For EAN, UPC and ITF-14 you can leave the check digit off and the tool adds it, or include it and the tool checks it.
- Adjust the size if you need to. Keep dark bars on a light background and leave the blank margin on each side of the bars.
- Download the PNG for documents and web pages, or the SVG for print, where it stays sharp at any size. Always test-scan a printed copy before you use it.
When to use it
- Labelling shelves, bins, tools or equipment with Code 128 or Code 39 barcodes for your own inventory.
- Making an EAN-13 or UPC-A image for a product when you already hold the number (this tool does not issue numbers).
- Checking or completing the check digit before a label goes to print.
- Producing ITF-14 codes for outer cartons, or an SVG that prints crisply at any size.
How a linear barcode works
A linear (one-dimensional) barcode stores data in the widths of its bars and gaps. A scanner sweeps a line of light across it and measures how long it sees dark and light. Each barcode type defines which patterns of widths stand for which characters, plus start and stop patterns that tell the scanner where the code begins and ends and which way it is facing.
Retail codes such as EAN-13 and UPC-A are purely numeric and end with a check digit, a number calculated from the others. When a scanner reads the code, it recalculates the check digit; if the result does not match, it rejects the scan rather than report a wrong number.
Worked example: the EAN-13 check digit. Take the first 12 digits 400638133393. Starting from the right, multiply the digits alternately by 3 and 1: 3×3 + 9×1 + 3×3 + 3×1 + 3×3 + 1×1 + 8×3 + 3×1 + 6×3 + 0×1 + 0×3 + 4×1. That adds up to 9 + 9 + 9 + 3 + 9 + 1 + 24 + 3 + 18 + 0 + 0 + 4 = 89. The check digit is the amount needed to reach the next multiple of 10, which is 90 − 89 = 1. The full number is 4006381333931. Enter the first twelve digits as EAN-13 and the tool shows the same result.
The blank margin matters
Every barcode needs a blank area on both sides, called the quiet zone, so the scanner can tell where the bars begin. As a rule, leave at least 10 bar widths on each side (EAN and UPC need a little more on the left, at least 11). If a barcode will not scan, a cropped or crowded margin is one of the first things to check, along with low contrast, bars that are too thin for the printer, and blurry or stretched images.
Making a barcode is not the same as owning the number
This tool draws any valid number, but the numbers in EAN and UPC barcodes on retail products are assigned through GS1, which gives each company its own prefix so that no two products share a number. If you plan to sell products in shops or on marketplaces that require GS1 barcodes, get your numbers from GS1 or an authorised reseller. Use this tool to create the image once you have the number. For labels used only inside your own business, Code 128 or Code 39 with your own IDs is fine.
| Type | What it can encode | Length | Typical use |
|---|---|---|---|
| Code 128 | All 128 ASCII characters | Variable | Shipping labels, inventory, internal IDs |
| EAN-13 | Digits | 12 + check digit | Retail products worldwide |
| EAN-8 | Digits | 7 + check digit | Small retail packages |
| UPC-A | Digits | 11 + check digit | Retail products in North America |
| UPC-E | Digits | 6 digits (8 with system and check digit) | Small packages in North America |
| Code 39 | A–Z, 0–9, space and - . $ / + % | Variable | Industrial labels, ID badges, inventory |
| ITF-14 | Digits | 13 + check digit | Cartons and outer packaging |
| Interleaved 2 of 5 | Digits, in pairs | Even number of digits | Warehousing and logistics |
Frequently asked questions
What is the best barcode type for my own products or inventory?
Code 128 is the usual choice. It encodes letters, digits and punctuation in a compact bar pattern and almost every scanner reads it. Use EAN or UPC only when a retailer requires them.
Can I use these barcodes to sell products in stores?
You can use the image, but not just any number. Retail EAN and UPC numbers must come from GS1 so they are unique to your product. A random number may already belong to someone else’s product.
What is a check digit?
It is the last digit of a retail barcode, calculated from the others. Scanners recalculate it, and a mismatch means the barcode was misread. This tool adds it for you or checks the one you typed.
Why will my barcode not scan?
The usual causes are low contrast, bars too thin or blurred when printed, a missing blank margin, or a skewed or resized image. Print larger, use black on white, keep the margins and test with a real scanner.
What is the difference between a barcode and a QR code?
A barcode is read in one direction and holds a short code, typically up to a few dozen characters. A QR code is two-dimensional and can hold a web address or longer text. See our QR code generator if you need that.
Are the barcodes I create stored anywhere?
No. The barcode is drawn in your browser and nothing you type is uploaded or logged. Downloads are created on your device.
Sources and further reading
- GS1: How to calculate a check digit manually (opens in a new tab) – the check digit method used for EAN, UPC and ITF-14
- GS1: Barcodes (opens in a new tab) – how GS1 numbers and retail barcodes are assigned
- JsBarcode on GitHub (opens in a new tab) – the open-source library (MIT) that draws the bars