What is a barcode?
A barcode is an optical, machine-readable representation of data as a pattern of bars and spaces (1D) or square modules (2D) that a scanner or camera reads and converts into a number or text. Barcodes identify products, pallets, components, samples and assets without anyone having to retype anything. In industrial automation they are the cheapest bridge between the physical product and systems such as MES, ERP, WMS, LIMS and CMMS.
🧠 How does a barcode work?
A scanner illuminates the code and measures the difference in reflectance between dark and light elements. Software turns that pattern into characters and passes the result on to an application.
- Print or mark - the code sits on a label, on the packaging or directly on the part (direct part marking by laser or dot peen)
- Illuminate - a laser scanner sweeps a line across the code, a camera-based imager captures an image
- Detect - the sensor measures the transitions between light and dark
- Decode - software recognises the symbology and checks the check digit or error correction
- Forward - the data goes to a PLC, a terminal or an application server
In a 1D code the information is held in the widths of bars and spaces. In a 2D code it is held in two dimensions: a grid of modules with fixed finder patterns, so the code can be read at any angle. 2D codes contain Reed-Solomon error correction, so they remain readable when part of the symbol is damaged. Laser scanners read 1D codes and stacked codes such as PDF417; matrix codes such as DataMatrix and the QR code need a camera-based imager, which reads every type.
What a code contains is usually a key, not a full data set: a GTIN, a serial number, a batch number, a location code or an asset ID. The meaning only arises in the database that the key points to.
🕰️ How did the barcode come about?
Norman Joseph Woodland and Bernard Silver applied in October 1949 for a patent on a “classifying apparatus” with both linear and circular (bull’s-eye) codes; US patent 2,612,994 was granted on 7 October 1952. The breakthrough came only with retail: in 1973 the US grocery industry chose the Universal Product Code (UPC), and on 26 June 1974 the first product was scanned in Troy, Ohio - a packet of chewing gum. In 1977 the European EAN code followed in Brussels, the basis of the EAN-13 you now see on almost every consumer product.
Two other codes mattered for industry. Code 39, developed at Intermec in the 1970s, was the first symbology that could also encode letters and became popular in automotive and defence. Code 128 was introduced in 1981 and encodes the full ASCII character set in a more compact symbol. In 1994 DENSO WAVE released the QR code for scanning automotive parts, and since 2005 the merged EAN and UCC organisations have managed the standards worldwide as GS1.
🔢 What types of barcodes are there?
| Symbology | Type | Standard | Content | Typical use |
|---|---|---|---|---|
| EAN-13 / UPC-A | 1D | ISO/IEC 15420 | 13 / 12 digits | Consumer products at the checkout (UPC mainly in North America) |
| ITF-14 | 1D | ISO/IEC 16390 (Interleaved 2 of 5) | 14 digits | Outer cases and trays, also on corrugated board |
| Code 39 | 1D | ISO/IEC 16388 | Digits, capitals, a few symbols | Internal labels, automotive, defence |
| Code 128 | 1D | ISO/IEC 15417 | Full ASCII | Logistics, production, internal tracking |
| GS1-128 | 1D | GS1 on Code 128 | GS1 elements (AIs) | Pallet labels with SSCC, expiry date, lot |
| DataMatrix | 2D | ISO/IEC 16022 | Up to 3,116 digits | Medicines, UDI, part marking |
| QR Code | 2D | ISO/IEC 18004 | Up to 7,089 digits | Web addresses, GS1 Digital Link, rating plates |
| PDF417 | 2D stacked | ISO/IEC 15438 | Over 1 kB | Identity documents, transport documents |
| Aztec | 2D | ISO/IEC 24778 | Over 1 kB | Rail tickets and boarding passes |
GS1-128 is not a separate symbology: it is Code 128 with a special start character (FNC1) and fixed GS1 data fields (Application Identifiers), so every recipient in the chain recognises the same fields. The same principle applies to GS1 DataMatrix and the GS1 QR code.
🏭 Where are barcodes used in IT/OT?
| Application | Example | Linked system |
|---|---|---|
| Receiving and storage | Scanning a pallet label with an SSCC at goods receipt | WMS, ERP |
| Production orders | Scanning an order number to start an order on a line | MES |
| Material verification | Scanning a raw material before it goes into a batch | batch control, MES |
| Routing | Scanning a box on a sorter to choose the exit | PLC |
| Genealogy | Linking a serial number to measurements and process data | Historian, MES |
| Maintenance | Scanning the code on a pump to open the work order | CMMS, asset management |
| Laboratory | Scanning a sample container at analysis | LIMS |
| Pick-and-place | Identifying a part before a robot picks it | Robotics, vision |
| Safety | Scanning a badge at access or when issuing PPE | Access control, ERP |
A scan on the shop floor can therefore load a recipe, start batch recording or send a product to another line. That makes the barcode not just an IT data item for supply chain management, but also a control signal for OT that becomes visible in SCADA. Industrial scanners therefore often have an IP65 or IP67 housing, a trigger input and a direct connection to the controller over Industrial Ethernet, such as ProfiNET, IP or Modbus TCP, or still over a serial link. Increasingly, scanners also publish their results via OPC UA or into a Unified Namespace.
🔍 How do you measure barcode quality?
A code that only just reads today can fail tomorrow at a customer or in a different scanner. That is why an objective quality measurement with a verifier exists.
- ISO/IEC 15416 (1D) - the verifier measures ten scan lines across the code. Each line receives a grade per parameter: symbol contrast, minimum reflectance, minimum edge contrast, modulation, defects, decodability and decode. The lowest grade determines the line, and the average of the ten lines gives the overall grade from 4.0 (A) to 0 (F). The third edition has applied since 2025.
- ISO/IEC 15415 (2D) - a comparable assessment for matrix codes, including axial and grid non-uniformity and unused error correction.
- Quiet zone - with GS1, the light margin beside a linear code must generally be at least ten times the X-dimension (the width of the narrowest bar).
| Context | Common requirement |
|---|---|
| GS1 pallet label (GS1-128) | Grade C (1.5) or better under ISO/IEC 15416 |
| Medicines in the EU (DataMatrix) | At least 1.5 under ISO/IEC 15415 as a presumption of conformity |
| GS1-128 in logistics | X-dimension 0.495 to 1.016 mm, quiet zone 10X |
| EAN-13 at the checkout | X-dimension nominally 0.33 mm |
| Inline inspection | Read every code with a vision camera, reject on failure |
A verifier that follows the standard is not the same as a scanner that reports “it reads”: only the verifier gives a measurable, comparable result for GMP and customer audits.
⚖️ Which rules apply in the EU and the Netherlands?
- Medicines - since 9 February 2019, most prescription medicines under Delegated Regulation (EU) 2016/161 carry a DataMatrix with product code, serial number, batch number and expiry date.
- Medical devices - the MDR (2017/745) and IVDR (2017/746) require a UDI, in practice usually encoded in DataMatrix or GS1-128 and issued via GS1, HIBCC, ICCBBA or IFA. The US FDA has a comparable UDI rule.
- Food - traceability has been mandatory since 2005 under Article 18 of Regulation (EC) 178/2002; barcodes are the usual carrier for tracking and tracing.
- Retail - with Sunrise 2027, an initiative that started at GS1 US, GS1 asks retailers to make their checkouts ready for 2D codes by the end of 2027, so a QR code with GS1 Digital Link (ISO/IEC 18975) can appear alongside or instead of the EAN-13.
- Product passports - the battery passport must be reachable via a QR code from 18 February 2027, and the digital product passport uses a comparable data carrier.
🔐 What security risks do barcodes have?
A barcode has no authentication: every scanner trusts whatever is printed. That creates risks that are often overlooked.
- Label manipulation - a replaced or counterfeit label can bring a wrong batch, a fake serial number or a wrong route into the system. In regulated supply chains this leads to incorrect recalls or falsified medicines.
- Malicious QR codes - a QR code on a machine or poster can lead to a phishing site (quishing, a form of phishing).
- Injection via scanner input - a handheld scanner often behaves like a keyboard. A code with unexpected characters or commands can mislead applications that do not validate their input.
- OT impact - if a scan selects a recipe or machine parameters, a wrong code can cause a wrong product or downtime.
Measures: validate every scan (check digit, format, expected product type), use serialisation with a central check for duplicate numbers, protect data integrity with audit logging, and include scanners and printers in the cybersecurity inventory of the OT environment.
🔄 What is the difference between a barcode and RFID?
| Property | Barcode | RFID |
|---|---|---|
| Line of sight | Required | Not required |
| Cost per label | Fractions of a cent (printed) | Higher, one chip per tag |
| Read range | Centimetres to several metres (long-range scanners) | Centimetres (HF) to metres (UHF) |
| Changing data | No, reprint | Often writable |
| Bulk reading | One code at a time | Dozens of tags at once |
| Environmental sensitivity | Dirt, wear, reflection | Metal and liquids |
Barcodes remain dominant thanks to low cost, simplicity and worldwide GS1 standardisation. RFID is gaining ground where bulk reading or reading without line of sight is needed; labels often carry both. At the same time, reading is moving to cameras: vision AI reads damaged codes while inspecting the product, and scan data feeds IIoT platforms, industrial AI and the digital twin of a production line.
🏭 Practical example: serialisation in pharmaceuticals
A packaging line at a Dutch medicines manufacturer prints a GS1 DataMatrix with GTIN, serial number, batch number and expiry date on every carton. The MES or a dedicated serialisation system retrieves the serial numbers and supplies them to the printer. Directly after the printer, a vision camera reads every code, checks its content and print quality and rejects faulty cartons. Cartons are then linked to an outer case and the cases to a pallet with an SSCC (aggregation), so a single scan describes the whole pallet. Before the batch is released, the manufacturer uploads the numbers via the EU hub to the European verification system (run in the Netherlands by NMVO), where the pharmacy decommissions them at dispensing. Audit trails, access control and a validated line are GMP requirements here.
❓ Frequently asked questions
What is the difference between a 1D and a 2D barcode?
A 1D barcode encodes data in the widths of bars and spaces and usually holds a few dozen characters. A 2D barcode, such as DataMatrix or the QR code, uses a grid of modules and can hold thousands of characters with built-in error correction. Matrix codes do, however, require a camera-based imager instead of a laser scanner.
Which barcode is most used in industry?
In industry, Code 128 and GS1-128 are the most widely used linear barcodes, especially on pallet and case labels. For small parts, medicines and medical devices, DataMatrix is the standard because it fits a lot of data on a small surface.
How much information fits in a barcode?
An EAN-13 barcode holds exactly 13 digits, and a Code 128 barcode in practice a few dozen characters. A DataMatrix holds up to 3,116 digits and a QR code up to 7,089 digits. In practice a barcode usually holds only a key, such as a GTIN or serial number, that points to a database.
Can a damaged barcode still be read?
A 2D barcode can often still be read when part of it is damaged, thanks to Reed-Solomon error correction; at its highest level a QR code can recover from roughly 30 percent loss. A 1D barcode has at most a check digit and fails sooner with dirt, scratches or poor printing. That is why industry often uses laser-marked DataMatrix codes in harsh conditions.
What does a barcode verifier do?
A barcode verifier measures the print quality of a barcode objectively under ISO/IEC 15416 (1D) or ISO/IEC 15415 (2D) and gives a grade from A to F. An ordinary scanner only reports whether the code can be read. Suppliers to retail, logistics and pharmaceuticals often have to achieve at least grade C.
Is a barcode secure against counterfeiting?
A barcode itself offers no protection against counterfeiting, because any code can easily be copied. Security only comes from unique serial numbers that are checked centrally, as with medicines in the EU, combined with validation of every scan.
📌 In summary
A barcode is a machine-readable carrier of a key, such as a GTIN or serial number, that connects the physical product to MES, ERP, WMS and the control system. By choosing the right symbology, measuring print quality under ISO/IEC 15416 or 15415 and validating every scan, you turn a simple label into a reliable basis for traceability and automated production.
