Barcodes look alike at a glance, but the stripes on a cereal box, a shipping carton and a warehouse shelf label follow different rules about what they can hold and how they are checked. Picking the wrong format can mean a label that will not scan, or a retail number that a shop will not accept. This guide explains the common linear barcode formats, shows how check digits are calculated, and covers what you need to know before you print.
How a linear barcode works
A linear (one-dimensional) barcode stores data in the widths of dark bars and light spaces read from left to right. The narrowest bar or space is called a module, and every other element is a whole number of modules wide. A scanner sweeps across the symbol, measures the pattern of widths and decodes it into characters.
Every symbol has the same basic parts:
- Quiet zones: blank margins on the left and right that tell the scanner where the code begins and ends.
- Start and stop patterns: fixed patterns that mark the edges and let the code be read in either direction.
- Data characters: the encoded content.
- A check character in most formats, which lets the scanner detect a misread.
- Human-readable text printed underneath, so a person can type the number if scanning fails.
Because they store data in one direction only, linear barcodes hold far less than two-dimensional codes. If you need a web address or a long piece of text, a QR code is the better tool; see QR codes explained for how those work.
The formats at a glance
The Preslo Barcode Generator supports six formats. This table summarises them:
| Format | Can encode | Length | Check digit | Typical use |
|---|---|---|---|---|
| EAN-13 | Digits only | 13 (12 + check) | Yes, modulo 10 | Retail products in most countries |
| UPC-A | Digits only | 12 (11 + check) | Yes, modulo 10 | Retail products in the US and Canada |
| EAN-8 | Digits only | 8 (7 + check) | Yes, modulo 10 | Very small retail packs |
| ITF-14 | Digits only | 14 (13 + check) | Yes, modulo 10 | Outer cartons and cases |
| Code 128 | Standard ASCII characters | Variable | Built in, not printed in the text | Inventory, assets, shipping references |
| Code 39 | A–Z, 0–9, space and - . $ / + % | Variable | Not required | Industrial, automotive and ID labels |
EAN-13 and UPC-A: retail product codes
EAN-13 is the barcode on most packaged goods sold in shops worldwide. Its 13 digits form a Global Trade Item Number (GTIN): a company prefix issued by GS1, an item reference chosen by the company, and a final check digit. The first digits identify the GS1 member organisation that issued the prefix, not necessarily the country where the product was made.
UPC-A, common in the United States and Canada, is closely related. A 12-digit UPC-A number is the same as an EAN-13 number with a leading zero, so 036000291452 and 0036000291452 describe the same item and share the same check digit. Retail scanners in most countries read both.
EAN-8 is a shortened version for packs too small for an EAN-13 symbol. Its numbers are allocated separately and sparingly, so it is not simply an EAN-13 with digits removed.
ITF-14: shipping cartons
ITF-14 is based on Interleaved 2 of 5, a digits-only symbology that encodes digits in pairs: one digit in the bars and the next in the spaces between them. It prints well on corrugated cardboard, which is why it appears on outer cases rather than on the products inside.
An ITF-14 number usually starts with an indicator digit showing the packaging level, followed by the first 12 digits of the product's GTIN and a newly calculated check digit. For a case of the product 5901234123457 with indicator 1, the first 13 digits are 1590123412345 and the check digit works out as 4, giving 15901234123454. Which indicator digit to use is a decision for your GS1 numbering, not for the barcode software.
Code 128: the general-purpose choice
Code 128 can encode all 128 standard ASCII characters: upper and lower case letters, digits, punctuation and some control characters. It switches between three internal code sets, one of which packs pairs of digits into a single symbol character, so long numbers stay compact. That makes it the usual choice for inventory labels, asset tags, order numbers and internal systems.
Code 128 always contains a check character calculated with modulo 103. The encoder adds it automatically, and it is not shown in the human-readable text, so you never type it yourself. Accented letters, emoji and non-Latin scripts are not part of standard ASCII and do not scan reliably, which is why the Preslo tool asks you to remove them.
Code 39: older but still common
Code 39 supports 43 characters: capital letters, digits, the space and the symbols - . $ / + %. Each character uses nine elements, three of them wide, and the symbol starts and ends with an asterisk that scanners use as a delimiter. It is less compact than Code 128, so the same text produces a wider barcode, but it is simple and still found on industrial, automotive, military and ID labels. Code 39 does not require a check character. The Preslo generator converts lowercase letters to capitals for you.
How a check digit is calculated: a worked example
EAN-13, UPC-A, EAN-8 and ITF-14 all use the same modulo-10 method. Starting from the rightmost data digit and moving left, multiply the digits alternately by 3 and 1, add the results, and choose the digit that brings the total up to the next multiple of ten.
For EAN-13 the 12 data digits 590123412345 are weighted 1, 3, 1, 3 and so on from the left, which is the same as 3, 1, 3, 1 from the right:
| Digit | 5 | 9 | 0 | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 5 | 27 | 0 | 3 | 2 | 9 | 4 | 3 | 2 | 9 | 4 | 15 |
- Add the products: 5 + 27 + 0 + 3 + 2 + 9 + 4 + 3 + 2 + 9 + 4 + 15 = 83.
- The next multiple of ten is 90.
- 90 − 83 = 7, so the full number is
5901234123457.
If the total is already a multiple of ten, the check digit is 0. The same steps give 2 for the UPC-A data 03600029145 and 4 for the EAN-8 data 9638507. The check digit catches every single-digit mistake and most swaps of two neighbouring digits, which are the most common typing errors, but it is not a security feature.
Retail numbers must be licensed
Anyone can draw an EAN-13 barcode, but the number inside it is what matters. Shops and online marketplaces generally expect product numbers issued through GS1, the organisation that manages retail barcode numbers, via its member organisation in your country. Making up a number, or reusing one from another product, can lead to rejected listings or a scan that brings up someone else's item. A barcode generator cannot issue or register numbers. For stock that never leaves your business, Code 128 with your own reference numbers avoids the question entirely.
Step by step: making a barcode with Preslo
- Open the Barcode Generator and type the value to encode.
- Choose the format. For internal labels, Code 128 is the safe default. For retail, use the format that matches your licensed number.
- For EAN-13, UPC-A, EAN-8 or ITF-14, enter just the data digits and the check digit is added for you. If you enter the full number, the tool verifies the last digit and tells you the correct one if it is wrong.
- Press Generate Barcode or Enter. If the value does not fit the format, a message explains what to change.
- Download a PNG (rendered at four times screen resolution) for documents and label software, or an SVG vector file for packaging artwork and print shops. Both keep a white background and quiet zones.
Everything is drawn in your browser, so the values you type are not uploaded.
Printing tips for barcodes that scan
- Contrast: print dark bars, ideally black, on a white or very light background. Many scanners use red light, so red bars can look the same as the background and disappear.
- Quiet zones: keep the side margins clear of text, borders and edges. As a guide, EAN-13 needs at least 11 modules on the left and 7 on the right, and Code 128 needs at least 10 modules on each side.
- Size: retail symbols have a defined size range. An EAN-13 at its nominal 100% size is about 37.29 mm wide (including quiet zones) by 25.93 mm high, and GS1 specifications set limits on how far it can be scaled. Check the requirements for your use before shrinking it.
- Proportions: scale the whole barcode evenly. Stretching it in one direction changes the ratio of bar widths.
- Resolution: use the SVG for professional printing. On low-resolution label printers, long Code 128 values can make bars too thin, so shorten the value if needed.
- Surface: avoid glossy wrap that reflects light, curved surfaces that bend the bars, and placing the code across a fold or seam.
- Test a printed sample with the scanner or app that will actually be used before printing a batch.
Common mistakes
- Using an invented EAN-13 or UPC-A number on products sold through retailers.
- Choosing EAN-13 for internal stock codes that contain letters; use Code 128 instead.
- Typing a wrong check digit, or adding one to a Code 128 value by hand.
- Cropping the quiet zones when placing the image in a layout.
- Printing in light colours, on dark backgrounds, or with the bars reversed.
- Expecting a linear barcode to hold a URL or long text, which is a job for a QR code.
- Assuming the tool supports formats it does not. Two-dimensional codes such as Data Matrix and PDF417 are not offered here.
Key takeaways
- EAN-13 and UPC-A identify retail products, EAN-8 is for tiny packs, and ITF-14 is for shipping cartons.
- Code 128 is the flexible default for internal labels; Code 39 is older and less compact.
- The modulo-10 check digit uses alternating weights of 3 and 1 and catches most typing errors.
- Retail product numbers come from GS1; a generator only draws the barcode.
- Good contrast, clear quiet zones and correct sizing matter as much as the data.
