EAN-13 vs Code 128: the short answer
EAN-13 is a 13-digit, numbers-only barcode used on retail products all over the world, including almost every packet in an Indian shop. Code 128 is a flexible barcode that can hold letters, numbers and symbols of any length, used for internal codes, cartons and logistics.
In a shop: use EAN-13 for anything a customer buys, including your own in-store codes. Use Code 128 only when your item code has letters or a length that is not a valid retail number.
The barcode types side by side
| Type | Holds | Where you see it | Use it in a shop for |
|---|---|---|---|
| EAN-13 | Exactly 13 digits; the last is a check digit | Packets, bottles, books; Indian brands start with 890 | Selling items, in-store codes starting with 2, scale labels |
| UPC-A | Exactly 12 digits | Goods made for the US and Canada; some imports | Scanning imports; not for making your own codes |
| EAN-8 | Exactly 8 digits | Very small packs: lip balm, small sachets, small tubes | Scanning only; real EAN-8 numbers are issued by GS1 for space-constrained packs |
| Code 128 | Letters, numbers, symbols, any length | Courier labels, cartons, internal item codes, invoice numbers | Item codes like SH-42-BLK; bill numbers printed as barcodes |
| QR code | Text, links, payment details, a lot of data | UPI payment, websites, menus, e-invoices | Payment and links, not item billing at most counters |
You may also meet Code 39 (an older letters-and-numbers code, wide and less dense than Code 128) and DataMatrix (a small square 2D code, common on medicines and electronics parts). A 2D scanner reads both. More on scanners is in the guide to choosing a barcode scanner.
EAN-13 in detail
An EAN-13 number has three parts:
- Prefix and company number: the first digits. Numbers starting with 890 are issued by GS1 India to brand owners. Numbers starting with 20 to 29 are kept by GS1 for in-store use, so a shop can make its own without clashing with any brand.
- Item reference: the brand's own number for that exact product and pack size.
- Check digit: the 13th digit, worked out from the first 12.
EAN-13 is short and dense, so it fits on a 38x25 mm label, and every retail scanner in the world reads it. Its limit is that it holds only digits and always exactly 13 of them. That is fine for a product number, and it is why scale labels also use EAN-13: the digits carry the item and the weight or price. That layout is in the guide to weighing scale barcodes.
How the EAN-13 check digit works: a worked example
The check digit lets the scanner catch a misread. If one bar is smudged and a 3 reads as an 8, the check fails and the scanner stays silent instead of billing the wrong item. Here is the calculation for the example number 890246813579 (12 digits; we will find the 13th).
- Write the 12 digits in positions 1 to 12. 8 9 0 2 4 6 8 1 3 5 7 9.
- Add the digits in odd positions (1st, 3rd, 5th, 7th, 9th, 11th): 8 + 0 + 4 + 8 + 3 + 7 = 30.
- Add the digits in even positions (2nd, 4th, 6th, 8th, 10th, 12th): 9 + 2 + 6 + 1 + 5 + 9 = 32.
- Multiply the even total by 3: 32 × 3 = 96.
- Add the two: 30 + 96 = 126.
- Find what takes it to the next multiple of 10: 130 − 126 = 4. If the total already ends in 0, the check digit is 0.
So the full barcode is 8902468135794. To check a number in seconds, use the free EAN-13 check digit calculator.
Try changing one digit: 890246813578 (last 9 changed to 8) gives a total of 123 and a check digit of 7. One small change, a different check digit. That is how a single misread gets caught.
A common shop problem: someone types 13 random digits as an in-store code. Nine times out of ten the last digit is wrong, and the software or scanner rejects it. Always calculate it.
UPC-A and EAN-8
UPC-A is the 12-digit cousin of EAN-13, used in the US and Canada. A UPC-A number is the same as an EAN-13 with a 0 in front: UPC 012345678905 is EAN 0012345678905. Many scanners can send it either way. The only shop rule: save it in your item list the same way your scanner sends it, or the item will not be found.
EAN-8 is for packs too small for EAN-13. GS1 India allocates these (it calls them GS1-8) for products with space constraints. A shop should not make up EAN-8 numbers; use EAN-13 with a smaller label instead.
Code 128 in detail
Code 128 can hold capital and small letters, digits and symbols, and any length. It has its own hidden check character, so scanners catch misreads with it too. Long runs of digits pack tightly, so a 10-digit number in Code 128 is narrower than you might expect.
Use it when:
- Your item codes have letters, like a saree shop's design code KS-0412-RED.
- Your code is not 8, 12 or 13 digits, like a five-digit item number 10457.
- You want a document number as a barcode, such as a bill number printed on a bill for quick returns.
Two cautions. First, Code 128 gets wider as the code gets longer, so a 15-character code may not fit a 38 mm label; keep codes short. Second, Code 128 is not a retail product number. If you supply goods to other shops, they expect an EAN-13 from GS1, not a Code 128 label. See how to create a barcode for products for which number to use when.
You may also see GS1-128 on cartons from big suppliers. It is Code 128 with GS1 data inside, such as a batch, an expiry date or a carton number, marked with numbers in brackets like (10) or (17). Your counter does not need to bill from it.
QR codes: useful, but not for item billing
QR codes hold far more than a barcode: a web link, a UPI payment request, an e-invoice's signed data. A 2D scanner or a phone camera reads them. In shops they suit payment QR on the counter or bill, links to your WhatsApp or online shop, and menus. For the item on the shelf, an EAN-13 stays faster to print, cheaper to scan and works with every scanner, including old 1D ones.
Which barcode type to use, by situation
| Situation | Use |
|---|---|
| Packet already has a barcode | Nothing to print; save the maker's code to the item |
| Unbarcoded item sold only in your shop | EAN-13 in-store code starting with 2 |
| Weighed pack of rice or sweets | EAN-13 scale barcode (prefix 20 to 29, often 21 or 22) |
| Garment with a design code containing letters | Code 128 of the design code, or give it an in-store EAN-13 |
| Your own brand sold in other shops or online | EAN-13 from GS1 India |
| Payment or a link | QR code |
If in doubt, in-store EAN-13 is the safer choice for anything sold at the counter: every scanner reads it and it fits small labels. Preview any type with the free barcode generator.
How Cartix Prime picks the type
Cartix Prime prints EAN-13, UPC-A or EAN-8 when the number is a valid retail code, and Code 128 for anything else, so a design code with letters still prints and scans. Items with no barcode can get an in-store EAN-13 on every plan, checked to be unused in your shop. Labels show barcodes only: Cartix Prime does not print QR codes on labels. The bill number can be printed on the bill as a barcode, and a UPI QR for amounts due is a bill design option. Label printing is on Silver and up; see the barcode label printing page, or if your counter is full of items that will not scan, read fixing items without barcodes.