Tag Archives: barcode codification

You can read a barcode using only your eyesight

Although it might  seem that barcodes are very complex and just a computer can decode it, the truth is that the way they work is very simple.

UPC Barcodes are made up of a series of vertical lines with different thickness and a number below them. Well, the information that those lines encode is no other than the same number that you can read with your eyes, just that they are designed for a reliable read from a machine, usually a laser scanner.

Ok, now that you know what information is in those lines, this is how to read them:

  • The barcode is composed by black and white lines. Both are important.
  • Lines in UPC barcodes can have four different thickness. The skinniest line will be our unit reference for a number 1 and the thickest will be our reference for a number 4. Once you detected the skinniest line, then you can compare it and find the next thicker line and that will be the reference for number 2. ┬áLines with a thickness between this and the thickest will be a 3.
  • Every barcode starts and ends with a 101 (thin black, thin white, thin black). Also every UPC barcode has a 01010 (thin white, thin black, thin white, thin black, thin white) in the very middle. You can detect this 01010 because there are two lines sticking down the numbers.
  • Each number is made up of four lines which together occupies the same space (if you add them they will be 7 units wide).
  • Once you know this you can use the following code table to decode each digit :
  • So, the barcode above starts with 101-3211-1411 where the 101 just marks the beginning of the barcode, it’s not a digit. The 3211 is the digit 0 and 1411 is digit 3