In the more modern 2D barcodes (QR codes), different sized black or white dots contain the information.
The QR code can contain more characters for the same amount of space, but is more susceptible to contamination overall. However, because QR codes are used as web links in printed materials, on products or homepages, they are primarily used on modern smartphones.