The Basic Idea — Data as Lines
At its core, a barcode is a way of encoding numbers or letters as a visual pattern of black bars and white spaces of varying widths. A scanner reads those widths, runs a decoding calculation, and converts the pattern back into the original data — all in a fraction of a second.
Think of it like Morse code. Morse encodes the alphabet as sequences of short dots and long dashes transmitted over time. A barcode does the same thing, but spatially: narrow bars and spaces represent one binary value, wide bars and spaces represent another. Scan left to right and the sequence of widths spells out a number.
The great advantage over typing is speed and accuracy. A trained cashier might enter 12 digits in 5 seconds with occasional errors. A barcode scanner reads the same 12 digits in under 100 milliseconds with near-zero error rates.
What's Actually in a Barcode?
Different barcode formats store data differently, but the EAN-13 standard used on most retail products worldwide is a good example. Its 13 digits are divided into four functional segments:
- Country prefix (digits 1–3): Identifies the GS1 member organization that issued the company prefix — not necessarily where the product was made. The prefix 690–699 belongs to China, 300–379 to France, 000–019 to the United States.
- Company prefix (digits 4–7 or longer): Uniquely identifies the brand or manufacturer. Assigned by GS1 when a company registers.
- Product reference (remaining digits except the last): Assigned by the company itself to identify a specific product variant.
- Check digit (last digit): A mathematically derived digit calculated from the preceding 12. If a scanner misreads a single digit, the check calculation fails and the scan is rejected rather than ringing up the wrong item.
The check digit is a simple but powerful error-catching mechanism. It's calculated by alternately multiplying digits by 1 and 3, summing the results, and deriving the remainder from 10. Change any one of the first 12 digits and the check digit no longer matches — the scanner knows immediately that something went wrong.
How Does a Barcode Scanner Read It?
Most barcode scanners — whether a handheld laser gun, a built-in checkout belt scanner, or a smartphone camera — follow the same basic process:
Light source illuminates the barcode
A laser scanner sweeps a focused red beam across the barcode. An LED or imager-based scanner floods the label with light and captures the entire symbol at once, like taking a photo.
Sensor detects reflected light
Black bars absorb light and reflect very little back to the sensor. White spaces reflect strongly. As the light sweeps across the barcode, the sensor records a waveform of high and low reflectance values corresponding to each bar and space.
Analog signal is converted to digital
The reflectance waveform is digitized into a sequence of 0s and 1s. The width of each high or low segment — measured in time for laser scanners or in pixels for imagers — determines which binary value each bar or space represents.
Decoder reconstructs the original data
The scanner's built-in decoder applies the rules of the barcode symbology (EAN-13, Code 128, etc.) to translate the bit sequence back into human-readable characters. It also verifies the check digit. The whole process takes under 100 milliseconds.
Data is sent to the host system
The decoded string is passed to the connected software — a POS system, inventory database, or warehouse management application — which looks up the product, logs the transaction, or triggers the next workflow step.
1D vs 2D Barcodes — What's the Difference?
Not all barcodes are made of parallel lines. Two-dimensional (2D) barcodes store data as a grid of squares or dots, allowing them to hold far more information in a compact space.
| 1D Barcode | 2D Barcode | |
|---|---|---|
| Shape | Parallel vertical lines | Grid of squares or dots |
| Data capacity | Up to ~80 characters | Up to ~3,000 characters |
| Scanner needed | Laser or CCD line scanner | Camera or 2D imager |
| Best for | Retail, warehouse, shipping labels | URLs, product info, mobile check-in |
| Common examples | Code 128, EAN-13, Code 39, UPC-A | QR Code, Data Matrix, PDF417 |
| Readable when damaged? | Partially (if bars are still intact) | Yes — built-in error correction |
For most small business applications — product labels, shipping labels, inventory management — a 1D barcode such as Code 128 or EAN-13 is the right choice. It works with any scanner, prints cleanly even on basic thermal printers, and carries all the data you need.
What Do the Numbers Under a Barcode Mean?
The digits printed in human-readable form below (or beside) a barcode are called the Human Readable Interpretation (HRI). They serve as a backup: if a scanner fails or the barcode is damaged beyond recognition, a cashier or warehouse worker can type those digits in manually to get the same result.
For a UPC-A barcode — the 12-digit standard on US retail products — the digits break down like this:
- First digit: Number system character (0 = standard retail product, 2 = weight item, 3 = health/drug, 5 = coupon)
- Digits 2–6: Manufacturer code, assigned by GS1 US
- Digits 7–11: Product code, assigned by the manufacturer
- Digit 12: Check digit
You'll notice the HRI on a UPC-A is split by the barcode itself — a single digit on the far left, five digits on the left half, five digits on the right half, and a single check digit on the far right. This split reflects the internal structure of the UPC-A encoding, which is divided into left and right halves with different encoding tables to prevent the scanner from reading the barcode backwards.
Why Do Some Products Have No Standard Barcode?
EAN-13 and UPC-A barcodes require a paid GS1 membership to obtain a globally unique company prefix. That's a cost and process that only makes sense if you're selling through major retail channels.
For internal use — warehouse bin locations, employee ID cards, work-in-progress tracking, internal inventory systems — you don't need GS1 registration at all. Any sequence of numbers or letters can be encoded in Code 128 or Code 39. As long as your own scanning system knows what those numbers mean, the barcode does its job perfectly.
This matters for small businesses. If you're managing stock in your own store or warehouse, you can invent your own SKU numbering scheme, encode it in Code 128, and have a fully functional inventory scanning system without spending a cent on GS1 registration. You only need a registered GTIN if an external retailer or marketplace requires it.
How to Create Your Own Barcodes
There are several ways to generate barcodes, depending on your budget and volume:
- Professional label software (BarTender, NiceLabel): Full-featured desktop apps with templates and printer integrations. Cost starts at several hundred dollars per year — worthwhile for large-scale operations.
- Excel barcode font plugins: Install a barcode font and format cells to render as barcodes. Limited flexibility and the output quality depends heavily on the font. See our guide to barcode fonts for Excel for a full breakdown.
- Online bulk generators: Upload a CSV or Excel file, choose your barcode format, and download a print-ready PDF or a ZIP of individual PNGs. No software to install, no cost for basic use.
For small and medium businesses, an online bulk generator covers most needs. You get high-resolution output, correct quiet zones, and the ability to generate hundreds of barcodes from a spreadsheet in one step — without learning specialist software.
Ready to create your own barcodes? Upload your product list to Bulk Barcode Generator — pick Code 128 for internal use or EAN-13 for retail, and download print-ready labels in seconds. Free, no signup required.
Generate Barcodes Free →