What Is a Barcode? Definition, How It Works, and Types
A barcode is a way of writing data as a pattern that machines can read. The pattern usually consists of black and white lines of different widths, or small squares arranged inside a square. When scanned, the pattern is translated back into numbers or text, such as a product code, a tracking number, or a website address.
Because they are read by machines, barcodes are much faster and far less error-prone than typing codes by hand. That is why barcodes are used at checkouts, in warehouses, hospitals, and on tickets, all the way to food packaging.
A brief history of the barcode
The idea of the barcode was patented in 1952 by Norman Joseph Woodland and Bernard Silver in the United States. Barcodes were only truly used in stores in 1974, when a pack of chewing gum was scanned with a UPC code at a supermarket in Ohio. Since then, barcodes have spread around the world and are now managed globally by a standards organization called GS1.
How does a barcode work?
A scanner shines light on the barcode and then reads the reflection. Dark areas reflect little light, while light areas reflect a lot. That difference is converted into a sequence of 0s and 1s, which is then matched against the rules of that barcode type. Many barcodes also have a check digit, which is the last digit calculated from the digits before it. If the calculation does not match, the scanner knows something is wrong and rejects the result.
The barcode itself usually stores only a code. Information such as the product name or price is stored in the checkout system or a database, and is looked up based on that code.
Commonly used types of barcodes
In general, barcodes fall into two major groups:
- 1D (linear) barcodes: vertical lines that are read from left to right. Examples include EAN-13 and UPC-A for retail products, as well as Code 128 and Code 39 for logistics and warehouses.
- 2D barcodes: square patterns that store data in two directions, so they can hold much more. Examples include QR Code, Data Matrix, PDF417, and Aztec.
There are also special barcodes for postal and shipping services, healthcare, and GS1 standards for supply chains. You can read a more detailed explanation of the differences in the article The Difference Between 1D and 2D Barcodes.
What are barcodes used for?
- Retail: speeding up checkout and recording stock automatically.
- Warehousing and shipping: tracking goods and parcels from one place to another.
- Tickets and events: verifying that tickets are genuine with a single scan.
- Marketing: a QR Code on a brochure or package takes people straight to your website, menu, or WhatsApp.
Creating your own barcode
You do not need a paid app to create a barcode. At I Need Barcode, choose a barcode type, enter your data, and download it as a PNG image. There are more than 100 types to choose from, and all of them are free with no sign-up.
Frequently Asked Questions
What is the difference between a barcode and a QR Code?
A QR Code is one type of barcode, namely a 2D barcode. Line (1D) barcodes store only a few characters and are read from left to right, while a QR Code stores data in two directions, so it can hold a link, text, or WiFi details.
Does a barcode store the product's price?
Usually not. A product barcode contains only a code. The product's price and name are stored in the checkout system and looked up based on the scanned code.
Do I have to pay to create a barcode?
No. Barcode images can be created for free, for example at I Need Barcode. The only thing that requires paid registration is an official number for retail product barcodes such as EAN-13, through GS1.


