A barcode is an optical machine-readable representation of data relating to the object to which it is attached. 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.