TOOLTIKI Lovable tool, really free

The last digit of a barcode is doing the checking

A thirteen-digit retail barcode carries twelve digits of actual number and one digit of arithmetic. The last one is computed from the other twelve, so a scanner that misreads a bar can tell immediately that something is wrong rather than returning the wrong product.

That is why a made-up barcode number does not work. The check digit either matches or it does not, and the calculation takes about ten seconds to do by hand.

How is the check digit calculated?

By weighting the digits alternately and taking what is missing from the next multiple of ten. Working from the left across the first twelve digits, the odd positions count once and the even positions count three times.

Step Working
Number 590123412345
Odd positions ×1 5+0+2+4+2+4 = 17
Even positions ×3 (9+1+3+1+3+5) × 3 = 66
Total 83
Check digit 10 − 3 = 7

The completed code is 5901234123457. If the total had ended in zero the check digit would be zero rather than ten, which is the only special case in the rule.

Weighting by three is what makes the scheme catch transpositions. A plain sum would give the same total for two swapped adjacent digits; the alternating weights give a different one, so the most common human error is detected.

What is the difference between the retail formats?

Mostly geography and one digit. The twelve-digit format used widely in North America is the same scheme one digit shorter, and it becomes the thirteen-digit form by adding a leading zero — so a scanner reading either produces a number the other system recognises.

Book numbers are the same format again with a reserved prefix. An ISBN in its current form begins 978 or 979 and is otherwise an ordinary retail barcode, which is how a bookshop till and a supermarket till can use identical hardware.

The older ten-digit book number used different arithmetic — a modulo-eleven check that occasionally produced a remainder of ten, written as an X. That is the entire explanation for the X that sometimes appears at the end of an older ISBN.

What does the prefix mean?

The organisation that issued the number, not where the product was made. The leading digits identify a numbering authority, and that authority usually corresponds to a country — but a company can register in one country and manufacture anywhere.

Reading a prefix as a country of origin is a widespread misconception and it is wrong often enough to be useless. The number identifies who assigned it, and nothing more.

Numbers are also allocated to a company rather than to a product, with the company assigning the rest. That is why a range of numbers belongs to one manufacturer and why buying a single barcode outside that system is possible but awkward.

When is a different symbology right?

When the data is not a product number. The retail formats hold a fixed count of digits and nothing else, so anything variable-length or containing letters needs a different encoding.

The general-purpose alternative handles the full character set and any length, and it has a mode that packs pairs of digits into a single symbol — so for numeric data it is roughly twice as dense as it looks. That makes it the usual choice for internal labels, shipping references and asset tags.

The bars themselves are the data in every case. The digits printed underneath are a convenience for humans and for the moment a scanner fails, and nothing reads them optically in normal operation.

What makes a printed barcode fail?

Narrow bars printed too small, and quiet zones too tight. Every symbology defines a minimum width for its narrowest bar, and printing below it produces bars that blur into each other at the resolution of a scanner.

Scaling a barcode image non-proportionally is the other frequent cause. Stretching horizontally changes the bar widths relative to each other, which is exactly the information being read.

Contrast and finish matter as much as with any optical code. A glossy laminate reflecting the scanner’s own light back at it defeats a technically perfect barcode.

Where should the code sit on the packaging?

Somewhere flat, unobscured and consistent. A code wrapped around a curve distorts the bar widths from the scanner’s viewing angle, and one crossing a seam or a fold is read as damaged.

The convention of placing it on the back lower right exists so that a checkout operator can find it without turning the item over repeatedly. On a small package that space may not exist, which is where the shorter formats earn their place.

Questions people ask

Do the digits underneath have to be printed? For retail formats, yes — they are the fallback when a scan fails and a till needs the number typed in.

Can I invent a barcode number? For internal use, yes, provided the check digit is right. For retail sale the number has to be one allocated to you.

Why is my number rejected by a marketplace? Either the check digit is wrong or the number is not registered to your company.

Does the height of the bars matter? It affects how easily a scanner finds the code at an angle. Cropping them short makes scanning fussier.

Can two products share a number? They should not. Variants in size or colour each need their own.

Compute the digit rather than guessing it. The barcode generator covers the common symbologies, and the format-specific ones handle EAN-13, UPC-A, Code 128 and ISBN.