What is a barcode? Structure, how it works and types explained
A barcode – also known as a ‘strichcode’ in German – is a machine-readable representation of data using parallel lines and spaces. What began in 1974 with the first packet of chewing gum scanned at a checkout in Ohio is now an indispensable part of retail, logistics, medicine and industry. In this guide, we explain how barcodes work, how they are structured, what types there are and where they are used.
What is a barcode?
A barcode is an optical code in which information is encoded using a sequence of light and dark elements. In a classic, one-dimensional barcode, these are vertical bars of varying widths. In modern two-dimensional codes (such as QR codes or Data Matrix), the bars are replaced by small squares or dots that carry information in both directions.
The difference compared to a normal number on the packaging: a barcode can be read by a scanner in a fraction of a second without any errors. Staff no longer need to type anything in – this saves time and prevents input errors.
How does a barcode work?
A barcode scanner directs a beam of light (usually red laser light or an LED) onto the code. The light areas reflect the light strongly, whilst the dark bars absorb it. A light-sensitive sensor converts the reflected light into an electrical signal – a sequence of ‘light’ and ‘dark’. This sequence is translated into numbers or letters by the scanner’s electronics and transmitted to the till, the ERP system or the warehouse software.
Modern 2D codes such as QR codes or Data Matrix are no longer read using a laser beam, but with a small camera. This allows for significantly larger amounts of data to be stored in a very small space and also enables scanning with smartphones.
Structure of a barcode
Every barcode has a clearly defined structure. Taking an EAN-13 code as an example:
- Quiet zone: A lighter area to the left and right of the code, enabling the scanner to recognise the start and end.
- Start character: Defines the start of the code and calibrates the scanner to the module width.
- Data characters: The actual information – e.g. country prefix, manufacturer number and item number.
- Separator: In EAN-13, this separates the left from the right half.
- Check digit: A calculated check digit that detects reading or printing errors.
- End character: Marks the end of the code.
The width of the narrowest bar – the so-called module – determines the overall size. The larger the module, the more reliably the code can be scanned from a greater distance. Print quality, contrast and sufficient quiet zone are the most common reasons why a barcode is not recognised.
What types of barcodes are there?
There are well over 100 different barcode standards. In practice, only just under a dozen are truly relevant. A distinction is made between two main groups:
1D barcodes (bar codes)
| Standard | Usage | Character set |
|---|---|---|
| EAN-13 / EAN-8 | Retail products, supermarket checkouts | Digits |
| UPC-A / UPC-E | US retail | Digits |
| Code 39 | Industry, inventory, warehouse | A–Z, 0–9, some special characters |
| Code 128 | Logistics, shipping labels | Full ASCII set |
| ITF / 2 of 5 Interleaved | Outer packaging, cartons | Digits |
| GS1-128 | Logistics units (NVE / SSCC) | Full ASCII set |
| PZN | Pharmacies in Germany | Digits (7 or 8 digits) |
2D codes (matrix codes)
| Standard | Usage | Special feature |
|---|---|---|
| QR code | Marketing, tickets, payments, smartphone scans | Up to 4,296 characters, error correction |
| Data Matrix | Pharmaceuticals (UDI), electronics, medical devices | Very space-saving, readable from 1×1 mm |
| PDF417 | ID cards, freight documents, boarding passes | Stacked code, high data density |
| Aztec | Rail tickets, boarding passes | Does not require a quiet zone |
What are barcodes used for?
Barcodes are now used wherever objects need to be uniquely identified or tracked:
- Retail: EAN codes at checkouts, stock management in the branch system.
- Logistics: Code 128 and GS1-128 on shipping labels, parcel tracking, NVE.
- Industry and manufacturing: Code 39, Data Matrix for component traceability.
- Warehouse management: Inventory labels with Code 39 or Code 128 for unique asset identification.
- Medical and pharmaceutical: Data Matrix codes on medicine packaging, PZN codes in pharmacies, UDI for medical devices.
- Events and tickets: QR or Aztec codes on admission tickets and boarding passes.
- Maintenance and inspection: Inspection labels with barcodes for comprehensive documentation of DGUV V3 and UVV inspections.
Having barcode labels printed
Three factors are crucial for reliably readable barcodes: contrast, print quality and the right label material. Barcodes can be printed much more precisely on smooth films than on rough paper. For outdoor or chemical-resistant applications, polyester or polyimide films are the right choice.
At barcodeetiketten.com, you can obtain professionally pre-printed barcode labels in all common standards – with a scan guarantee, in almost any size, on rolls or sheets. Our configurators for universal labels and inspection stickers guide you to the desired variant in just a few steps.
Frequently asked questions about barcodes
What is the difference between a barcode and a barcode?
There is no difference. ‘Barcode’ is the international term, whilst ‘strichcode’ is the German translation. Both refer to the same machine-readable code consisting of light and dark elements.
How does a barcode scanner work?
The scanner shines light onto the code. Light areas reflect the light strongly, whilst dark bars absorb it. A sensor converts the reflected pattern into an electrical signal, which the electronics translate into numbers or letters.
Which barcode is right for my product?
EAN-13 is mandatory for retail products. Code 39 or Code 128 are commonly used in warehouses and industry. Data Matrix is used on small components or medical devices. The QR code is the standard for marketing and smartphone scans.
Can I create barcodes myself?
Technically, yes. For internal purposes (warehouse, stock, inspection labels), barcodes can be generated using any label software or online. However, EAN/GTIN numbers, which are mandatory for retail, must be assigned by GS1.
What is the difference between 1D and 2D codes?
1D codes (barcodes such as EAN, Code 128) store information in only one dimension. 2D codes (QR codes, Data Matrix) store information in two dimensions and can hold significantly more data in a very small space.
Why won’t my barcode scan?
Common causes include: module width too small, missing quiet zone, insufficient contrast between bars and background, poor print quality or a material that is too glossy. A preliminary check with a verifier helps to avoid problems.
Questions about the right barcode labelling for your project? Call us on +49 7164 - 918 0456 – we’d be happy to advise you personally.
