A barcode is a machine-readable representation of a unique number, allowing retailers to track product sales in their inventory system. It typically consists of dark ink on a light background, forming high and low reflectance patterns that are converted to binary digits. UPCs (12 digits) and EANs (13 digits) are common types of barcodes.