
Understanding 2D DataMatrix & QR Codes on Medicine Packs
How serialization works, what the GS1 fields inside the code mean, and how to verify a pack officially.
6 min readUpdated
Table of contents9 sections
Quick answer
A 2D DataMatrix code on a medicine pack follows the GS1 standard and contains the product GTIN (01), expiry (17), batch (10) and a unique serial (21). Decoding it shows the data; only the official DRAP track-and-trace system can confirm the serial is genuine and not already dispensed.
Key takeaways
- A 2D code can carry a unique serial number for each individual pack.
- Reading the code is not the same as verifying it — only the official system can confirm the serial.
- A regular barcode (EAN-13) identifies a product line, not a specific pack.
What's inside the code
Most pharmaceutical 2D codes follow the GS1 standard and contain up to four Application Identifiers (AIs):
| AI | Field | Example |
|---|---|---|
| (01) | GTIN — product identifier | 08901234567890 |
| (17) | Expiry date (YYMMDD) | 270630 |
| (10) | Batch / lot | A1234 |
| (21) | Unique serial number | X7K29Q4M |
DataMatrix vs QR code: what's the difference?
| GS1 DataMatrix | QR code | |
|---|---|---|
| Shape | Small square, often with an L-shaped border | Square with three large corner markers |
| Used for | Pharmaceutical serialization worldwide | Marketing links, some verification schemes |
| Holds | GTIN, batch, expiry, serial (GS1 format) | Any text or a web link |
| Risk | Can be copied | Can point to a fake website |
Pakistan's track-and-trace programme uses 2D codes on serialised packs. Whichever type you see, decode it with a tool that shows the raw data rather than opening a link, like our code decoder.
How serialization stops fakes
- 1
Commissioning
The manufacturer prints a unique serial on each pack and uploads it to the national system.
- 2
Supply chain scans
Distributors and pharmacies scan packs as they move, building a history.
- 3
Dispensing
When sold, the serial is marked as dispensed.
- 4
Verification
If a copied serial appears again, the system can flag it as already dispensed or unknown.
That last step is why only the official portal can confirm a serial. Learn more in Mehfooz Dawa & DRAP track-and-trace.
If the code won't scan
- Use bright, even light and avoid glare on glossy cartons.
- Hold the phone 10–15 cm away and let it focus.
- Try uploading a sharp photo instead of live camera scanning.
- A code that never scans, while others do, may be badly printed: inspect the pack carefully.
How to check a pack
- 1
Decode
Use the DrugTrace Code Decoder to read the code with your camera or paste its text.
- 2
Cross-check
Confirm the decoded batch and expiry match what is printed on the pack.
- 3
Verify officially
Scan the same code on drugtrace.dra.gov.pk, DRAP's track-and-trace portal.
Common questions
What is a 2D DataMatrix code on medicine?
A small square code holding the GTIN, serial, batch and expiry. Decode it with our 2D code decoder or read about GTIN number checks.
Is a DataMatrix the same as a QR code?
No. Both are 2D, but medicines use GS1 DataMatrix for track and trace. See the medicine QR code scanner page.
Can I verify a DataMatrix officially?
Yes, with Mehfooz Dawa or drugtrace.dra.gov.pk, which check the serial against DRAP's records.
Sources & references
This guide is general information, not medical advice. DrugTrace.pk is independent and not affiliated with DRAP.
Topic hub
Mehfooz Dawa & Track and Trace
DRAP's official serial verification: Mehfooz Dawa, the portal and 2D codes.
- Mehfooz Dawa app ★
- Mehfooz Dawa check
- Drug track and trace portal
- drugtrace.dra.gov.pk guide
- Mehfooz Dawa & DRAP verification
- Medicine QR code scanner
- GTIN number check
- 2D DataMatrix codes (this page)
- Check medicine barcode
- 2D code decoder tool
Related topics
Keep reading
Using codesHow to Check a Medicine Barcode in Pakistan: 1D vs 2D Codes Explained
What the barcode on your medicine can and cannot prove, how to scan the new 2D codes, and how to spot a copied or mismatched code.
6 min read
Using codesMehfooz Dawa & DRAP Track-and-Trace: How Official Verification Works
What DRAP's track-and-trace system (Mehfooz Dawa) does, how to use it, its limits today, and how DrugTrace.pk complements it.
5 min read
Spotting fakesHow to Check if a Medicine Is Original or Fake in Pakistan (2026)
The complete 2026 method: physical checks, the batch number, the 2D barcode, DRAP's registry and official alerts, in the order pharmacists use them.
9 min read
