1D codes are the most familiar. The common UPC code found on grocery and consumer items is a linear code that uses variable-width lines and spaces to encode the data. These codes hold a limited number of characters; in order to add more numbers, the barcode itself has to be longer. 2D barcodes use a matrix or pattern to encode data. These patterns of squares, dots, hexagons and other shapes can be much smaller than linear codes but hold significantly more data (thousands of characters) because the information is encoded in both the vertical and horizontal dimensions of the pattern.