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 spacing of parallel lines. Later they evolved Into rectangles, dots, hexagons and other geometric patterns in two dimensions.