You encounter codes read by scanners everywhere you turn these days. From the stubby lines across the bottom of a letter to the tall black lines and numbers on a candy bar wrapper, barcodes make item tracking a breeze.
How do barcodes work, though? What looks like a random sequence of lines and shapes to you is actually a language all its own readable by a machine. Let’s look at what a barcode is used for and break down how the modern barcode works today.
How Do Barcodes Work?
Barcodes have come a long way since their first use on a pack of chewing gum in 1974. What started as a way to make grocery shopping more efficient now allows businesses to track a large amount of information quickly and easily.
The lines of a barcode are a way to write information in a visual pattern that a machine can read. The combination of elements tells the machine about the item like the price at a store or the name of a library book.
How barcode scanners work is by running a light across the pattern to translate it into information the machine can understand. The machine then sends the information back to a central database, helping to automate data collection and reduce human errors.
Types of Barcodes
Today, there are two types of barcodes you can use on your items – one-dimensional (1D) and two-dimensional (2D). The 2D version came about to answer the question of how to use barcodes to provide a greater amount of data.
1D barcodes are the basic “picket fence” style you’re used to seeing on products at the grocery store and can use up to 25 characters. That standard UPC can give information like product size and color, great for checkout and inventory purposes. Other variations include POSTNET used for encoding zip codes on mail and Codabar used by FedEx, libraries, and blood banks.
2D barcodes include more information than just text thanks to the fact that they can hold up to 2,000 characters. They often look like a square with a lot of black squares or squiggles in it. Examples you likely have seen would be QR codes in advertising or the code on a boarding pass.
What Do the Lines Mean?
To read the lines, a scanner needs to understand what they mean, and the developer to decide how to process them. Applications often use OCR in C# to build the library and scan with pinpoint accuracy.
As an example, a standard UPC contains a 12-digit number below a machine-readable set of black lines. The first six digits identify the manufacturer, while the next five identify the product right down to the variation of size or color. The last number is called a check digit, and its job is to tell the barcode scanner that the UPC is valid.
The Point of Barcodes
So, what is the point of barcodes? The lines there provide a ton of information that allows businesses to track inventory and assets, route returned mail, tag RSVP cards, or log customer invoices. What barcodes are used for today is only limited by your imagination and need.
If you found learning how do barcodes work interesting, check out our other articles related to tech tips, tricks, and how things work.