A barcode scanner (also called as a price scanner or a point-of-sale scanner) is a handheld or stationery input device used to capture, read and record the information stored in a bar code in the form of black and white lines. A barcode scanner has three components: a scanner, a decoder (which can be either external or may be built-in), and a cable to ensure a stable connection of the scanner with a desktop computer. A barcode scanner sends the data it captures on the barcode to a computer wherein a software application decodes it to get relevant information from the codes.
A barcode scanner basically directs a beam of light towards the barcode and captures the amount of light reflected back by the barcode. The dark lines in a barcode reflect less light whereas the white spaces reflects almost all of it. Thus, the amount of light reflected is then converted into energy in the form of electricity, which is later converted into data (numbers and letters) by the decoder and is then sent across to a computer.