A barcode is an optical machine-readable representation of data. Originally, barcodes represented data in the widths (lines) and the spacings of parallel lines, and may be referred to as linear or 1D (1 dimensional) barcodes or symbologies. They also come in patterns of squares, dots, hexagons and other geometric patterns within images termed 2D (2 dimensional) matrix codes or symbologies. Although 2D systems use symbols other than bars, they are generally referred to as barcodes as well. Barcodes can be read by optical scanners called barcode readers, or scanned from an image by special software.
The first use of barcodes was to label railroad cars, but they were not commercially successful until they were used to automate supermarket checkout systems, a task in which they have become almost universal. Their use has spread to many other roles as well, tasks that are generically referred to as Auto ID Data Capture (AIDC). Other systems are attempting to make inroads in the AIDC market, but the simplicity, universality and low cost of barcodes has limited the role of these other systems. It costs about half a United States cent (US$0.005) to implement a barcode while passive RFID still costs about $0.07 to $0.30 per tag.