A barcode is an optical machine-readable representation of data relating to the object to which it is attached. Originally barcodes systematically represented data by varying the widths and spacings of parallel lines, and may be referred to as linear or one-dimensional (1D). Later they evolved into rectangles, dots, hexagons and other geometric patterns in two dimensions (2D). Although 2D systems use a variety of symbols, they are generally referred to as barcodes as well. Barcodes originally were scanned by special optical scanners called barcode readers; later, scanners and interpretive software became available on devices including desktop printers and smartphones.
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 for which they have become almost universal. Their use has spread to many other tasks that are generically referred to as automatic identification and data capture (AIDC). The very first scanning of the now ubiquitous Universal Product Code (UPC) barcode was on a pack of Wrigley Company chewing gum in June 1974.
Other systems have made inroads in the AIDC market, but the simplicity, universality and low cost of barcodes has limited the role of these other systems until the 2000s (decade), over 40 years after the introduction of the commercial barcode, with the introduction of technologies such as radio frequency identification, or RFID.