A barcode reader, also known as a barcode scanner, is an electronic input device that can scan and decode barcodes. It consists of a light source, a lens, and a light sensor that translates optical impulses into electrical signals. Nearly all barcode readers also contain decoder circuitry that can analyze the barcodes image data provided by the sensor and send the barcodes content to the scanners output port. Barcode readers can be connected to a computer through a serial port, keyboard port, or interface device called a wedge. A barcode reader works by directing a beam of light across the barcode and measuring the amount and pattern of the light that is reflected. The scanner converts the light energy into electrical energy, which is then converted into data by the decoder and forwarded to a computer. Barcode readers come in many forms depending on their use case, including handheld, fixed-position, and portable slap and ship barcode scanners. Barcode scanners are used in a wide variety of settings, including retail stores, warehouses, and office buildings.