Pharmacode: Complete Guide to Pharma Barcodes
Pharmacode is a binary barcode used on pharmaceutical packaging lines to verify cartons and leaflets. Learn how it encodes numbers and how to read one.
Most barcodes you encounter, from a can of soup at the grocery store to a shipping label on a warehouse pallet, exist to identify something. Pharmacode does something different. It is a binary barcode built to catch packaging mistakes before a pharmaceutical product ever leaves the factory floor, and it has been quietly doing that job since long before most modern retail barcodes existed.
Try it yourself: Test how Pharmacode and other barcode formats scan with our free online barcode scanner.
What Is a Pharmacode Barcode?
Pharmacode is a one-dimensional symbology, formally called Pharmaceutical Binary Code, that the German company Laetus developed in the 1970s as a packaging control system for the pharmaceutical industry. Rather than storing a product's identity, it encodes a single integer between 3 and 131070 using a short sequence of narrow and wide bars.
That narrow numeric range is intentional. A Pharmacode symbol uses as few as 2 bars or as many as 16, and its job is not to carry rich product data the way a GTIN or NDC number does. Instead, each valid number typically represents one specific packaging configuration, such as a particular carton design paired with a particular folded leaflet, so a line-side scanner can confirm the right pieces are going into the right box.
Because it predates most of the barcodes still common today, Pharmacode is also one of the older symbologies still in active industrial use. It never went through ISO or GS1 standardization the way Code 128 or GS1 DataMatrix did, and it remains largely proprietary to Laetus equipment and compatible packaging-line hardware.
How Does Pharmacode Encode Data?
Pharmacode converts a number into binary and represents that binary value as a row of narrow and wide bars rather than as printed digits. This is the opposite of how a barcode like UPC or Code 39 works, since those formats encode each character as its own distinct pattern that maps back to a human-readable digit or letter.
Every bar in a Pharmacode symbol carries a weighted value based on its position, starting from the right. The rightmost bar has a weight of 1, and each bar moving left doubles that weight: 2, 4, 8, 16, and so on. A narrow bar contributes its position's weight to the running total, while a wide bar contributes twice that weight. Summing every bar's contribution yields the encoded number.
This structure explains the format's numeric limits. The smallest possible Pharmacode, the number 3, needs only two narrow bars (weights 1 and 2). The largest practical symbol uses sixteen wide bars, doubling each position's weight, which caps the format at 131070. There is no dedicated check digit, since the format relies on the packaging line's vision system, not the printed symbol alone, to catch errors.
Why Does Pharma Packaging Use Pharmacode?
Pharmaceutical packaging lines use Pharmacode to verify that every component of a finished pack, not just the product itself, is correct before sealing. A folding carton, its printed leaflet, and any blister foil each get assigned a matching Pharmacode number, and an inline vision system checks that the codes on all three agree before the pack moves further down the line.
This solves a problem that a single product identification barcode cannot. A GS1 barcode or GS1 DataMatrix code confirms what product a pack claims to be, but it does not by itself confirm that the leaflet inside is written in the correct language for that market, or that the carton matches the batch currently running. Mixing up leaflets or cartons between similar-looking product variants is a known risk in pharmaceutical manufacturing, and Pharmacode gives packaging lines an independent, fast check against it.
Pharmacode also supports print-quality verification. Because it can be printed in a color that contrasts against the packaging background, dedicated optical readers can use it to confirm that ink coverage, registration, and cutting are correct elsewhere on the pack, catching defects that would otherwise only surface during a manual inspection.
How Is Pharmacode Different From Other Barcodes?
Pharmacode differs from familiar barcodes in what it encodes, how it is read, and what equipment can decode it. Where formats like Code 39 or UPC encode human-readable digits and letters and get scanned left to right, Pharmacode encodes a pure binary value, is read right to left, and skips the check digit schemes that protect most other symbologies against misreads.
The other major difference is purpose. A GS1 DataMatrix code on a modern medicine pack, for example, carries a product's GTIN, batch number, expiry date, and a unique serial number for track-and-trace regulations such as the EU Falsified Medicines Directive. For a closer look at that format, see our GS1 DataMatrix guide. Pharmacode carries none of that regulatory data. It exists purely as a packaging-line control code, usually printed in addition to a product's real identification barcode rather than instead of it, which is why the two formats commonly appear on the same pack serving entirely different jobs. Barcodes used elsewhere in healthcare settings, covered in our guide to barcodes in healthcare, tend to follow the GS1 model rather than Pharmacode's binary approach.
How Do You Read a Pharmacode?
Reading a Pharmacode by hand means working right to left and assigning each bar a doubling weight. Start the rightmost bar at a weight of 1, double it for every bar moving leftward, add a bar's weight to the total if it is narrow, add double that weight if it is wide, and sum every bar to get the final number.
As an example, three bars read narrow, wide, narrow from right to left would contribute 1 (narrow, weight 1), 4 (wide, weight 2 doubled), and 4 (narrow, weight 4), for a total of 9. In practice, this decoding is handled automatically by dedicated Laetus-compatible readers built into packaging equipment, since manually verifying bar widths on a fast-moving production line is not practical.
Can Standard Barcode Scanners Read Pharmacode?
General-purpose barcode scanners, including most phone camera scanning apps, are usually not built to decode Pharmacode correctly. The format's reliance on precise bar-width measurement, its right-to-left reading order, and its occasional use of non-standard color contrast are tuned for the specialized optical readers built into pharmaceutical packaging lines rather than for general retail or logistics scanning equipment.
That said, a general scanner may still visually detect a Pharmacode symbol as a linear barcode-shaped object even if it cannot interpret its value correctly, since the symbol still looks like a conventional 1D barcode. Anyone working with pharmaceutical packaging who needs to actually decode a Pharmacode value should rely on software or hardware built specifically for the format rather than a general-purpose scanner.
Sources
- Wikipedia: Pharmacode - overview of Pharmacode's structure, numeric range, and encoding rules.
- Laetus: Introduction to Laetus PHARMA-CODE - background from the company that developed the format.
- IntuitionLabs: FMD Explained - A Guide to Pharma Serialization and Barcodes - context on GS1 DataMatrix and regulatory serialization requirements in pharmaceutical packaging.
- Zebra Technologies: What Is a Pharmacode? - scanner manufacturer overview of Pharmacode use and detection.