Blog · Guide

What the square code on your medication box means

By PillRem ·

Look closely at a box of prescription medicine bought in Europe and you will usually find two codes: the familiar striped barcode and a small square made of dots. That square is a DataMatrix code, and it holds more than most people expect.

Why the square code is there

Since 9 February 2019, prescription medicines sold in the European Union carry two safety features under the Falsified Medicines Directive: an anti-tampering seal and a unique identifier printed as a two-dimensional barcode. The rules say that barcode must be a machine-readable Data Matrix.

The goal is to stop falsified medicines. When a pharmacy dispenses a pack, it scans the code and checks it against a national database, so every individual box can be verified.

What the code contains

Under the EU rules, the unique identifier includes:

Data What it tells you
Product code The medicine, its strength, form and pack size
Serial number A random number unique to that single box
Batch number The production batch the box comes from
Expiry date The last day the medicine should be used
National number A reimbursement or national code, where a country requires it

In other words, one small square identifies the exact medicine and the exact box, including its expiry date.

The striped barcode is different

The classic linear barcode usually carries only a product number. It can tell an app which medicine you are holding, but not when that particular box expires. That is why the DataMatrix code is so useful: it is the only code on the pack that includes the expiry date.

How PillRem uses it

When you point PillRem at a medication box, it reads the barcode or the DataMatrix code and looks the product up in its database, built from official data from more than 40 countries and stored on your device. It then fills in:

  • the name and active ingredient,
  • the form, such as tablets or capsules,
  • and, when the box has a DataMatrix code, the expiry date.

Because the database lives on your iPhone, this works offline. If a box is not recognised, you can add it by hand in a few seconds.

Tips for a clean scan

  • Use good light and hold the phone steady.
  • Fit the whole square inside the frame.
  • If the box has both codes, try the square one first: it carries the most information.
  • Creased or shiny packaging can confuse the camera. Flatten the box or tilt it slightly to avoid reflections.

Questions people ask

Does scanning the code tell anyone what I take? Not with PillRem. The lookup happens on your device, and PillRem has no account or server that receives your data.

Do all countries use the square code? No. The EU requirement covers prescription medicines in EU countries. Other countries use different systems, and many over-the-counter products only have a linear barcode.

Can I trust the expiry date from the code? It is the same date printed on the box. If they ever differ, check with your pharmacist.

Sources

  1. Commission Delegated Regulation (EU) 2016/161, Chapter II: technical specifications of the unique identifier
  2. MHRA Inspectorate: Falsified Medicines Directive safety features (2019)

This article is general information, not medical advice. Follow your prescription and ask your doctor or pharmacist about your own treatment.

All articles