Barcode Generator
Guide: Barcodes Explained: EAN, UPC, Code 128 and Code 39
Any text and numbers. Common for shipping, inventory and labels.
Check digit: 2 (calculated for you)
Dark bars on a light background scan best, and a wider bar width prints more reliably. Barcodes for products sold in shops must use numbers registered with GS1, which this tool cannot do for you.
Nothing you enter or choose here leaves your device. This tool runs in your browser.
Choosing a type
| Type | Holds | Used for |
|---|---|---|
| Code 128 | Any text and numbers | Shipping labels, inventory, warehouse shelves |
| EAN-13 | 13 digits | Products in shops almost everywhere |
| UPC-A | 12 digits | Products in the United States and Canada |
| EAN-8 | 8 digits | Small packages with little room |
| Code 39 | Capital letters, digits and a few symbols | ID badges, industrial labels, older systems |
If you aren't selling in shops, Code 128 is the safe default. It holds anything and scanners read it everywhere.
The check digit, worked out
The last digit of an EAN or UPC number is a check digit, calculated from the others so a scanner can spot a misread. Type the number without it and the tool adds it. Here's the EAN-13 example 400638133393:
- Starting from the right of the 12 digits you typed, multiply them alternately by 3 and 1. That gives 3 times 3, 9 times 1, 3 times 3, and so on.
- Add the products. For this number the total is 89.
- The check digit is whatever brings the total up to the next multiple of 10. From 89 to 90 is 1.
The finished number is 4006381333931. In the same way, UPC-A 03600029145 becomes 036000291452, and EAN-8 9638507 becomes 96385074. If you type all the digits yourself, the tool checks that the last one is right.
Settings that affect scanning
- Bar width. Too narrow, and cheap scanners can't tell the bars apart after printing.
- Height. Taller is easier to hit with a scanner. Don't squash it to fit a small label.
- Quiet zone. The blank space on both sides. Keep it, or the scanner may not find where the code begins.
- Colors. Dark bars on a light background, with strong contrast. Red bars can be invisible to red-light scanners.
- Size. Product codes are normally printed between about 80 and 200 percent of the standard size. Don't go smaller.
Selling in shops
A shop or online marketplace wants numbers that belong to you. Those come from GS1, the organization that issues them, and each company gets its own prefix so no two products share a number. This generator draws a correct barcode for any number you type, but it can't register one. Don't use made-up numbers on products you sell, since a real product somewhere else may already use them.
Printing
Download SVG for print, since it stays sharp at any size, and PNG for documents and web pages. Test a printout with a real scanner, or a phone scanning app, before you print a thousand labels. Nothing you type is uploaded. For two-dimensional codes that hold links, use the QR code generator, and see the guide to barcodes for how the formats differ.
Written by Akinrinmade Michael · Updated October 24, 2026
How to use
- 1Choose the barcode type and type your number or text.
- 2Adjust the bar width, height and colors.
- 3Download the barcode as PNG or SVG.
Frequently asked questions
Which barcode type should I use?
Code 128 suits shipping, inventory and general labels because it holds any text. EAN-13 and UPC-A are for products sold in shops. Code 39 is common in industry and on ID badges.
Is the check digit added for me?
Yes. For EAN-13, UPC-A and EAN-8, type the number without its last digit and the check digit is added. If you type it, the tool checks that it is right. Code 128 adds its own check symbol.
Can I use these on products I sell in shops?
Shops and marketplaces need numbers registered with GS1. This tool draws a correct barcode for any number, but it can't register a number for you.
Which file should I download?
Use SVG for print, because it stays sharp at any size. Use PNG for documents and web pages.
Is my data sent anywhere?
No. Everything is made in your browser, so what you type never leaves your device.
Read the guide
Learn how this works and how to get the most from it.
Web & SEO
Barcodes Explained: EAN, UPC, Code 128 and Code 39
How the main barcode types differ, what the digits and check digit mean, tips for printing barcodes that scan, and how they compare to QR codes.
3 min read
Related tools
QR Code Generator
QR codes for links, Wi-Fi, contacts, email, phone and text. PNG or SVG.
UUID & Random Number Generator
Generate secure UUIDs (v4, v7) and random numbers.
ULID & NanoID Generator
Make sortable ULIDs and short random NanoIDs.
Base32 Encoder / Decoder
Encode and decode Base32, including hex and Crockford.