How to use the barcode generator
- Type the data. For product codes enter the digits without the check digit (12 for EAN-13, 11 for UPC-A, 7 for EAN-8, 13 for ITF-14) and it is calculated for you, or enter the full number and it is verified. Spaces and dashes are ignored.
- Choose the barcode type (see the table below). Code 128 is the safe choice for anything that isn’t a retail product number.
- Set the size. The narrow bar width is one module in pixels; every bar is a whole number of pixels, so the PNG stays sharp.
- Download the SVG for print and design software (it scales without blur) or the PNG for documents and label apps.
Your browser draws the barcode; what you type is never sent anywhere.
Barcode types
| Type | Encodes | Length | Typical use |
|---|---|---|---|
| Code 128 | Letters, digits, punctuation, space | Any (up to 80 here) | Shipping labels, inventory, asset tags, tickets |
| EAN-13 | Digits (a GTIN-13) | 13, last is a check digit | Retail products worldwide |
| UPC-A | Digits (a GTIN-12) | 12, last is a check digit | Retail products in the US and Canada |
| EAN-8 | Digits (a GTIN-8) | 8, last is a check digit | Small packages with no room for EAN-13 |
| Code 39 | A–Z, 0–9, space, - . $ / + % | Any (up to 40 here) | ID badges, industrial and older inventory systems |
| ITF-14 | Digits (a GTIN-14) | 14, last is a check digit | Corrugated shipping cartons |
Each type has a quiet zone, a blank margin the scanner needs to find the start and end. The images include it: 11 modules left and 7 right for EAN-13, 9 on each side for UPC-A, 7 for EAN-8 and 10 for Code 128, Code 39 and ITF-14, whose bearer frame sits outside the quiet zones. Don’t crop it, and keep other print out of it.
How the codes are built
Check digits (EAN, UPC, ITF-14). From the right, the digits are multiplied by 3, 1, 3, 1… and added; the check digit brings the sum up to the next multiple of 10, so a scanner can reject a misread.
Code 128 uses code set B for text and set C for digit pairs. It starts in C when the data opens with four or more digits and switches to C for runs of six or more digits (four at the end), the length-minimizing rules of ISO/IEC 15417. The check symbol is the start value plus each symbol’s value times its position, modulo 103.
Code 39 draws each character with nine bars and spaces, three of them wide (3 × narrow here); the optional check character is the sum of the character values modulo 43.
Worked examples
EAN-13 400638133393: from the right, 3·3 + 9·1 + 3·3 + 3·1 + 3·3 + 1·1 + 8·3 + 3·1 + 6·3 + 0·1 + 0·3 + 4·1 = 89, so the check digit is 1 and the code is 4006381333931. The leading 4 is not drawn as bars of its own; it sets the L/G pattern of the left half to LGLLGG.
Code 128 INV-20261015: Start B, I, N, V, -, Code C, 20, 26, 10, 15, check symbol, Stop. The check sum is 104 + 41·1 + 46·2 + 54·3 + 13·4 + 99·5 + 20·6 + 26·7 + 10·8 + 15·9 = 1,463, and 1,463 mod 103 = 21. Packing the date into pairs makes the code 134 modules wide instead of 167 in set B alone.
Retail numbers come from GS1
A generator can draw any number, but the number on a product you sell in stores or on marketplaces has to be yours. As GS1, the standards body behind EAN and UPC, puts it, every product sold online or in stores needs a unique identification number. You license a company prefix or a single GTIN from the GS1 office in your country (gs1.org; GS1 US in the United States), and that number identifies your company as the brand owner. Then this tool draws its barcode. For your own stock, equipment, library books or tickets, any Code 128 or Code 39 content is fine, because only your scanners read it.
Printing tips
- Size: GS1’s nominal EAN-13 module is 0.33 mm with 22.85 mm bars, allowed from about 80% to 200%. On a 300 dpi label printer, 4 px bars are 0.34 mm.
- Contrast: black on white. Most scanners use red light, so red, orange or yellow bars look like background.
- Don’t stretch a PNG; change the bar width or scale the SVG instead, and test a print with the scanner you will use. For links and long text, a QR code holds far more.
Frequently asked questions
Can I put these barcodes on products I sell in stores or online?
The barcode itself, yes; the number, only if it is yours. EAN-13 and UPC-A numbers for retail must be licensed from GS1 (GS1 US in the United States). Enter your licensed GTIN here and download the barcode. Made-up numbers can belong to another company.
Which barcode type should I use?
For retail products, the one your market expects: UPC-A in the US and Canada, EAN-13 elsewhere, with a GS1 number. For inventory, assets, shipping and anything with letters, Code 128 is compact and read by practically every scanner. Use Code 39 only when an older system asks for it, and ITF-14 for GTIN-14 numbers on shipping cartons.
Why won’t my barcode scan?
The usual causes are a cropped quiet zone, bars printed too small or blurred, low contrast or colored bars, and a scanner that has that barcode type switched off in its settings. Print larger, in black on white, with the margins intact, and check the scanner settings.
What is a check digit?
The last digit of an EAN, UPC or ITF-14 number, calculated from the others with the 3-1-3-1 weighting described above. It lets a scanner catch a misread. This tool adds it to 12-, 11-, 7- or 13-digit input and refuses a full-length number whose last digit is wrong.
Should I download SVG or PNG?
SVG for anything printed or scaled: label software, Illustrator, Canva or a web page. PNG for Word, Excel, Google Docs or apps that only take images; set a larger bar width first so it needs no stretching.
Last updated: October 15, 2026