Barcode scanners work by emitting light through the device onto a surface containing a readable barcode. The light is then reflected back into the lens of the device and a light sensor then recognises the barcode as readable data. A decoder then parses the data and transmits it to a database containing details on the scanned product, such as name, price, and so on.