How Bar Code Scanner Works?

Whenever we visit a supermarket, have you noticed the cashier checking each and every item and scanning something on them using a device? We believe everyone has seen it happen, so do you know about the process, and why does the cashier do that?

Each and every product that we purchase, regardless of its cost, has a unique coding scheme mentioned on the packaging. Those lines of codes are also addressed as Barcode which can only be scanned by using a barcode scanner.

So, if you wonder how that works and what information a barcode usually contains, stay on this article and read it until the end to know about it in detail. Let’s start then!

What is a Barcode Scanner?

Before we discuss how a barcode scanner works, we should read about what a barcode scanner is and for what purpose it is used for. Usually, in stores where managing inventories is a big task, we need to use a barcode scanner to keep a record of the products.

Barcodes are an encrypted code that consists of a sequence of linear lines along with a UPC number of 12 digits, which is unique for every product. While the first six digits of a barcode hold the information about its manufacturer, the following five next numbers have details about the product itself. The 12th digit of the barcode is just used for verification at the time of scanning whether the barcode is scanned properly or not.

So, to decode these details out of a barcode, scanners are used as they come with dedicated chipsets with decrypting algorithms programmed on them. Barcode scanners are of various types, some are wireless, wired, and some differ in their scanning methods. However, the basic function of every barcode scanner remains the same, which is to scan a code and decode the information that’s encrypted into it.

How Barcode Scanner Works?

We hope it’s clear to you what a barcode and barcode scanners are. So, to know about its working, we will have to dive a little deeper into the details.

Thus, if you are curious to know how a barcode scanner functions and scans codes, make sure to read this section very carefully. We are dividing the whole scanning process into four simpler stages so that you can understand it in a better way.

The Scanner throws a ray of light or lasers to scan the Barcode

That’s the first step that a barcode scanner does when you push the scanning button of the scanner. While some advanced scanners capture an image of the whole barcode at once, some barcode scanners do the job by partially scanning the barcode line by line.

The Rays are reflected back at the Scanner and fall on the light sensor

Once the light rays fall on a barcode, the light which is reflected back has variations since the darker lines of the barcode don’t reflect back as much light as the empty spaces between them do. With this phenomenon, the light sensor detects the width of the dark lines in barcode and easily distinguishes between their widths as well.

The Scanned Code is pushed for decoding

As we discussed earlier, barcode scanners have dedicated chipsets with decrypting algorithms programmed on them.

Based on the scanned barcode as fetched by the light sensor, the white spaces which reflect back good light rays are counted as 0s, and the black lines that don’t reflect light back are counted as 1s in the array of code. The code is decrypted into this binary sequence because a barcode scanner is usually connected with a computer. And, that’s not a new thing to tell that computers only understand the binary language.

Code is further decoded into important information on the computer

The scanners are only capable of decoding the barcode sequence into a binary sequence, that’s why we need to take help from computer software to decode the binary sequence into simpler language for our understanding. The scanned binary sequence can be as long as 128 bits, so the software approaches to break down the sequence into smaller sections and decode them separately. Once the information is decrypted completely, you can get to read the following information:

  • The type of Barcode which has been scanned by the scanner.
  • Information about the Manufacturer
  • Details of the Product, such as its name, price, etc.


Barcodes are highly useful in maintaining inventories as you can keep proper records of every product if it moves in or out of the inventory. These days, barcodes are even being used to keep a record of vaccinations provided at certain places, so everyone needs to have proper knowledge about these things.

We often see such things around us but only a few get curious to know more about them. We hope you have a better understanding of barcode and barcode scanners by reading this article.

In case you feel we have missed out on something to tell or have any other doubts regarding the topic. You can leave your thoughts down in the comments section and share them with us.