Which barcode type do I need? EAN, UPC, Code 128 or Code 39
Updated October 12, 2026 · 7-minute read · 11 sections
Which barcode type do I need? Ask who will scan it. A till in a shop wants EAN-13 or UPC-A, a forklift scanner at a dock wants an ITF-14 or GS1-128 label, and your own stock room can use anything you like, which in practice means Code 128. Pick the audience first and the symbol follows.
The wrong choice rarely shows up on screen. It shows up when a retailer rejects a listing, a carton label will not read on rough board, or a shelf label turns out twice as wide as the bin it has to fit.
Which barcode type do I need? Start from the job
| Job | Type | Data | Needs GS1 numbers? |
|---|---|---|---|
| Retail pack, worldwide | EAN-13 | 13 digits | Yes |
| Retail pack, US and Canada | UPC-A | 12 digits | Yes |
| Very small retail pack | UPC-E or EAN-8 | 8 digits | Yes |
| Books | EAN-13 with prefix 978 or 979 | 13 digits | ISBN agency |
| Outer carton | ITF-14 | 14 digits | Yes |
| Pallet or shipment | GS1-128 with SSCC | 18 digits plus others | Yes |
| Internal stock, assets, tools | Code 128 | Any ASCII | No |
| Existing legacy system | Code 39 or Codabar | Limited set | No |
Every row marked "Yes" has the same catch. The generator draws the bars; it does not issue numbers. Retail numbers come from your GS1 member organisation; the symbol rules are in the GS1 General Specifications. This site gives no licence to any number, and nothing here is legal advice.
Retail shelf: EAN-13 and UPC-A
An EAN-13 is a GS1 prefix, a company number, an item reference and a check digit, 95 modules wide with 7 modules per digit. The prefix identifies the GS1 member organisation that issued the number, not the country where the goods were made. Some prefixes mean something: 978 and 979 are books, 977 is serials, and 020–029 are restricted-use numbers for retailers' own in-store items (EAN-13).
A UPC-A is the 12-digit relative: a number system digit, five digits for the manufacturer, five for the product, and the check digit. An EAN-13 starting with 0 is a UPC-A with a zero in front. Number system 2 is for variable-weight goods priced in store, 3 is for drugs and 5 is for coupons (UPC). So UPC versus EAN is mostly a question of which one the buyer's system asks for; ask the retailer or marketplace before you print, and they will tell you.
Small packs: UPC-E and EAN-8
UPC-E squeezes a UPC-A into six digits by dropping zeros. It only works for numbers that actually contain the right run of zeros, and the scanner expands it back. EAN-8 is the short sibling of EAN-13: 81 modules including quiet zones, which is 26.73 mm at 100 % against 37.29 mm for EAN-13. Use these only when the pack really cannot fit a full code, and expect to need permission or a specific number from GS1; do not shorten a longer number yourself.
Cartons: ITF-14
ITF-14 carries a 14-digit GTIN, with the extra first digit marking the pack level, in an Interleaved 2 of 5 symbol. It copes with rough corrugated board better than fine-pitch symbols, which is why it is the carton code. It holds digits only, so there is no lower case and no letters. The check digit uses the same mod 10 rule as everything else on GS1 numbers: body 1234567890123 gives 12345678901231. Cartons are normally printed with a frame or bars around the code. The generator draws a bearer frame 3 X thick around the symbol; ask your carton printer or buyer if they want something different.
Logistics: GS1-128 and SSCC
GS1-128 is Code 128 with a special FNC1 symbol right after the start character, followed by application identifiers that tell the scanner what each field means: SSCC, batch, date, weight and so on (Code 128). An SSCC is 18 digits with a mod 10 check, for example 000123456789012343. I mention this honestly: the generator here prints plain Code 128, and structured GS1-128 with application identifiers belongs in your warehouse or labelling software. If a trading partner demands GS1-128, take their label specification first.
Internal stock and assets: Code 128
For anything that never goes near a retailer, I use Code 128 and stop thinking about it. It encodes printable ASCII in set B including lower case, and set C packs digit pairs into one symbol, and it has its own mod 103 check so misreads are rare. No outside number is needed, so you can use your own SKUs, bin names and tool tags.
| Symbol | Characters | Modules, without quiet zones |
|---|---|---|
| Code 128, set C | start + 4 pairs + check | 79 |
| Code 39 at 2:1 | 8 + start + stop | about 130 |
| Code 39 at 3:1 | 8 + start + stop | about 160 |
A Code 39 character takes 13 to 16 modules including the gap, depending on the wide-to-narrow ratio (2 to 3; the generator draws 3:1), and the start and stop each count as one. That is why a numeric Code 39 label is much longer than the same label in Code 128, and why on a small bin tag I do not use it. Code 39 also has no lower case: abc-123 becomes ABC-123, and the generator says so rather than quietly converting, with a button to switch to Code 128 if you want to keep the lower case. Choose Code 39 only when an existing system already scans it. See barcode size for printing for widths of Code 128 at real module sizes.
Libraries and blood banks: Codabar
Codabar uses digits plus a few symbols, and each code starts and ends with one of the letters A to D. It survives in older library and laboratory workflows. If a form asks for "NW-7", that is Codabar. For new work you can usually replace it with Code 128, but if the existing scanners and software were set up for Codabar, keep it so nothing else changes. Type just the digits and the generator adds the A at each end; if you type your own start and stop letters, use one at each end.
Code 93, MSI and Pharmacode
Code 93 uses the same characters as Code 39, upper case only, in a denser symbol, and it always carries two check characters, which the generator adds for you. I reach for it only when a customer asks. MSI is a digits-only symbol from older warehouse and shelf-label systems; the generator adds its mod 10 check digit by default. Pharmacode is a pharmaceutical packaging code that holds one whole number from 3 to 131070. Use these three only when a partner or an existing system names them; otherwise Code 128 does the job.
Do not invent or resell retail numbers
Making up an EAN or UPC "just to get a barcode" is the most common serious mistake I see. A made-up number can collide with a real product, and retailers can check the company prefix against GS1. Cheap resold numbers have a related risk, because the prefix may not be registered to you. If you sell through retail, get your numbers from GS1; if you do not, use Code 128 with your own codes. Whatever you choose, calculate the last digit rather than guessing it; the method is in how to calculate a barcode check digit.
Colours and inverted codes
Most scanners read with red light, so they see red, orange and yellow bars as blank paper. Keep the bars dark (black, dark blue, dark brown) on a light background, with plenty of contrast, and keep the quiet zone clear. White-on-black "inverted" codes are not read by many scanners; if the design needs that look, prefer a solid white box behind the code. The generator lets you change both colours and shows a warning for red-light colours, for light bars on a darker background and for low contrast; unless a design forces your hand, keep dark bars on a white background.
Quick pick
- Selling in shops: EAN-13 or UPC-A, with numbers from GS1.
- Selling books: EAN-13 with the ISBN number.
- Shipping cartons: ITF-14.
- Pallets and partner labels: GS1-128 with SSCC, from your label software.
- Your own stock, tools and assets: Code 128.
- Matching an old system: Code 39 or Codabar, only if it is already in use.
Questions and answers
What is the difference between UPC and EAN?
UPC-A has 12 digits and EAN-13 has 13. An EAN-13 starting with 0 is a UPC-A with a zero in front. Use the one your retailer or marketplace asks for.
What is the difference between Code 128 and Code 39?
Code 128 covers upper and lower case letters, digits and symbols, packs digit pairs into one symbol and is much shorter for numbers. Code 39 has only capitals, digits and a few symbols and is longer.
Which barcode should I use for inventory?
Code 128 with your own codes. It needs no outside numbers and handles lower case and long digit strings compactly.
Can I make my own UPC or EAN for a retail store?
Retail numbers come from your GS1 member organisation. Made-up numbers can collide with real products, so use Code 128 for anything internal. This is general information, not legal advice.