What Is a Barcode? Types and How They Work [2026]
A clear guide to what a barcode is, how barcodes work, the main barcode types like UPC and EAN, 1D vs 2D, and how to create one free.
You scan dozens of them a week without thinking about it, on groceries, parcels, boarding passes and warehouse shelves. A barcode is one of those quiet pieces of technology that makes modern commerce work. This guide explains what a barcode actually is, how it works, the main types you will run into, and how to make one yourself in a few seconds.
⚡ TL;DR
- A barcode is a machine-readable image that encodes data (usually a product or item number) as a pattern a scanner can read.
- 1D barcodes (Code 128, UPC, EAN) are rows of lines. 2D barcodes (QR, Data Matrix) are squares that hold far more data.
- UPC is the retail standard in North America, EAN is the retail standard most other places.
- You can create a barcode free with our barcode generator in seconds, no signup.
What Is a Barcode?
A barcode is a visual, machine-readable representation of data. Instead of a human reading a number and typing it in, a scanner reads the pattern and pulls out the value instantly and without errors. That value is almost always a reference, like a product number or an item ID, that points to a record in some system: a price at a checkout, a product in a warehouse, a parcel in a courier's network.
The key word is reference. A barcode on a tin of beans does not contain the price or the product name. It contains a number. The till looks that number up and finds the price. This is why the same barcode can mean different things in different systems, and why barcodes are only as useful as the database sitting behind them.
How Barcodes Work
A traditional 1D barcode encodes data in the widths and spacing of its vertical bars and the gaps between them. A scanner shines light across the code, measures the pattern of dark bars and light spaces, and decodes that pattern back into characters using the rules of whatever barcode standard, called a symbology, is being used.
Most 1D barcodes also include a check digit, an extra number calculated from the others. The scanner recalculates it on the fly and compares. If they do not match, the scan is rejected. That is why scanning is so much more reliable than typing: the format catches its own errors.
2D barcodes work differently. Instead of a single row of lines, they store data across a grid of squares, both horizontally and vertically. That two-dimensional layout lets them hold hundreds of times more data in a smaller space, and most include built-in error correction so they still scan even when part of the code is dirty or damaged.
1D vs 2D Barcodes
The simplest way to split the barcode world is one dimension versus two.
- 1D (linear) barcodes are the classic stripes. They store a short value, usually a number, and are read by laser scanners or cameras. Think of the code on a retail product.
- 2D barcodes are square matrix codes. They store much more data (URLs, batch details, full text) and are designed to be read by any smartphone camera. QR codes are the famous example.
Neither is better in the abstract. A retail product scanned thousands of times a day at a checkout wants a fast, simple 1D code. A shelf label you want staff to scan with a phone to pull up live stock is a great fit for a QR code.
The Main Barcode Types
There are dozens of symbologies, but a handful cover almost everything you will deal with.
| Type | Best for | 1D / 2D |
|---|---|---|
| Code 128 | Shipping labels, internal SKUs, asset tags. Encodes any characters. | 1D |
| UPC-A | Retail products in the US and Canada. The 12-digit checkout code. | 1D |
| EAN-13 | Retail products outside North America. The 13-digit consumer code. | 1D |
| Code 39 | Manufacturing, automotive, internal inventory. Letters and numbers. | 1D |
| QR Code | URLs, product links, shelf and bin labels. Scanned by any phone. | 2D |
| Data Matrix | Tiny parts and labels where space is tight. Holds a lot in a small square. | 2D |
If you just need a code for internal use, like labelling your own SKUs or assets, Code 128 is almost always the right choice. It is flexible, widely supported, and you do not need anyone's permission to use it.
Need a barcode right now? Use our free barcode generator, no signup. Then track what it is attached to with VNDLY.
Open the free generator →UPC vs EAN: What Is the Difference?
This trips people up constantly, so here is the short version. UPC-A is a 12-digit barcode used mainly in the United States and Canada. EAN-13 is a 13-digit barcode used in most of the rest of the world. EAN was effectively a superset of UPC, and modern retail scanners read both, so the practical difference is mostly geographic.
One important note if you sell retail products: the numbers behind UPC and EAN barcodes for products sold through major retailers are issued by GS1, the global standards body, via a company prefix. A barcode generator turns a valid number into a scannable image, but it does not register that number with GS1. For internal inventory you can use any numbering you like. For products going into shops, you usually need GS1-issued numbers.
How to Create a Barcode
You do not need special software or hardware to make a barcode. The steps are simple:
- Pick the right type. Code 128 for general and internal use, UPC or EAN for retail products, QR for anything you want a phone to scan.
- Enter your value, the number or text you want to encode.
- Generate it and download it as a PNG for quick printing or an SVG for crisp, scalable labels.
Our free barcode generator does all of this in your browser with no signup, and it handles all the common types including QR and Data Matrix. Whatever you type stays on your device.
How Barcodes Are Used in Inventory
This is where barcodes go from convenient to transformative. In a warehouse, every product, location and bin can carry a barcode. Instead of staff reading and typing SKUs, they scan. Receiving a purchase order, counting stock, picking an order, transferring between locations: each becomes a scan instead of a manual lookup. That is faster and, more importantly, far more accurate.
The barcode is only half the story though. Scanning is only useful if the scan updates a live inventory record. That is the difference between a label and a system. With VNDLY, your team can scan barcodes and QR codes straight from a phone using the free warehouse scanner app to receive POs, run stocktakes, check stock levels and fulfil orders, with no dedicated scanner hardware required. If you want to go deeper on the operational side, our guide to barcode scanning for inventory management covers the workflow in detail, and a solid SKU and barcode setup makes stocktakes dramatically faster.
VNDLY auto-assigns barcodes and lets you scan them with your phone. Free 14-day trial.
From the Founder
I ran a bootstrapped family products company for over a decade before building VNDLY. We sold physical goods across multiple warehouses, and barcodes were the difference between a stocktake taking a day and taking a week. Early on we did not barcode everything, and counts were a nightmare of squinting at handwritten SKUs. The moment we put a Code 128 label on every product and bin, accuracy jumped and arguments about what we actually had on hand basically disappeared.
A barcode is just a number until something is listening for it. The label is cheap. The value comes entirely from the system on the other end of the scan that knows what that number means and updates the moment you read it.
Frequently Asked Questions
What is a barcode in simple terms?
A barcode is a machine-readable image that encodes a value, usually a product or item number, as a pattern a scanner can read instantly. The scanner uses that value to look up information like a price or a stock record. You can make one free with our barcode generator.
What are the most common barcode types?
For retail products, UPC-A (North America) and EAN-13 (most of the world). For internal use, shipping and asset tags, Code 128 and Code 39. For 2D codes scanned by phones, QR Code and Data Matrix. Code 128 is the safest default for any internal labelling.
What is the difference between a barcode and a QR code?
A traditional barcode is 1D, a row of lines that stores a short value, usually scanned at a checkout or in a warehouse. A QR code is 2D and holds much more data, and is designed to be scanned by any smartphone camera. QR codes also have built-in error correction so they scan even when partly damaged.
Can I create a barcode for free?
Yes. Our free barcode generator creates Code 128, UPC, EAN, QR, Data Matrix and more in your browser with no signup and no watermark. You can download as PNG or SVG. For retail products sold through major shops, you will usually still need GS1-issued numbers behind your UPC or EAN codes.
Do I need a special scanner to use barcodes?
Not anymore. Dedicated laser scanners are still common in high-volume settings, but a smartphone camera reads both 1D and 2D barcodes well. VNDLY's free scanner app turns any iOS or Android phone into a warehouse scanner for receiving stock, counting and fulfilling orders.