Verify nowVerify

Barcode medicine identification: what the code on your medicine is for

Updated 5 min read MehfoozDawa.pk editorial team

Illustration: Barcode medicine identification: what the code on your medicine is for
Quick answer

Barcode medicine identification means giving each medicine pack a machine-readable code so it can be identified and checked electronically. Its main purpose is patient safety: catching counterfeits, preventing mix-ups and making recalls fast. In Pakistan the code is a 2D GS1 DataMatrix that also carries a serial number unique to each box.

Two kinds of barcode on medicine

Striped (1D) barcode2D barcode (GS1 DataMatrix)
ShapeVertical linesSmall square of dots with an L-shaped border
HoldsProduct numberProduct number, batch, expiry and serial
IdentifiesThe productThe individual pack
Used forBilling and stockVerification, tracing and recalls
Can detect a fake box?NoYes, through the serial number

A QR code is another kind of 2D barcode. Some packs use one to hold the same information as a web link.

The main purposes

  1. Detect counterfeit medicineA fake pack either has a serial that is not in the manufacturer's record, or one copied from a real pack that then shows up in many places.
  2. Trace and recallWhen a batch fails a test, the system knows where its packs went, so they can be pulled quickly.
  3. Reduce errorsScanning confirms the right product, strength and expiry at the pharmacy and, in hospitals, at the bedside.
  4. Give patients a checkAnyone with a phone can scan a pack before using it.

What information the barcode holds

Paste what a scanner reads, or tap a sample, to see the fields separate:

GTIN (01)
Serial (21)
Unique to one box
Batch (10)
Shared by the production run
Expiry (17)

For what each field proves, read GTIN, serial, batch and expiry explained.

How the barcode medicine identification system works, step by step

The manufacturer prints a unique code on every carton and uploads those codes to DRAP's track and trace system. Distributors and pharmacies can scan stock as it moves. When a patient scans, the system looks up that serial and answers: verified, not found, recalled or flagged. The rules behind it are covered in DRAP track and trace and S.R.O. 963(I)/2026.

Code decoder splitting a raw medicine code into GTIN, serial, batch and expiry
The decoder separates a raw scanner string into GTIN, serial, batch and expiry, and checks the GTIN check digit. Image: Screenshot of a MehfoozDawa.pk tool

Is there a public medicine barcode database?

You cannot browse serial numbers; they are checked one pack at a time. What is public is DRAP's product and price index, which you can search by name or registration number in our medicine price and registration search.

How a 2D DataMatrix stores data

A DataMatrix is a grid of black and white squares called modules. Two sides have a solid "L" border so the scanner knows which way up the code is; the other two sides alternate black and white so it can count rows and columns. Inside, the data is stored with error correction, so a code can still be read when part of it is scratched or smudged. DRAP's guidelines specify that the code begins with a special character called FNC1 that marks it as GS1 data, require a minimum print quality grade of C, and allow module sizes from 0.25 to 0.615 mm.

1D vs 2D at a glance

FeatureStriped barcode (EAN-13 and similar)GS1 DataMatrix
Data capacityAbout 13 digitsDozens of characters, including letters
Size on a packWideSmall square, often 1 to 2 cm
Damage toleranceLowHigh, thanks to error correction
Reads at any angleNot easilyYes
Phone camera friendlyYesYes

Barcodes in hospitals

In hospitals with barcode systems, nurses scan the medicine and the patient's wristband before giving a dose, and the system checks it is the right medicine, strength, dose and patient. Pharmacies use the same codes in automated dispensing machines and stock rooms to pick the right product and track expiry. Pakistan's track and trace system makes the codes available; how far individual hospitals use them inside their walls is up to each institution.

  • You can scan a pack to verify it, decode a code to see its fields, and search a product by name or registration number in our price and registration search.
  • You cannot download a list of serial numbers or look up a product from its GTIN in a public database; serials are checked one at a time by DRAP's system.

Dawa ka barcode kya batata hai

Dawa par bana chakor code (2D barcode) har dabbay ki pehchan hai. Is mein GTIN, batch, expiry aur ek munfarid serial number hota hai. Scan karne par DRAP ka system batata hai ke yeh pack asli record mein hai ya nahin. Lakeeron wala barcode sirf product batata hai, har dabbay ko nahin.

A sample GS1 DataMatrix code of the kind printed on medicine packs in Pakistan
A sample GS1 DataMatrix, the square code now printed on medicine cartons. This one is a demonstration code made with sample data, not a real product. Image: MehfoozDawa.pk

Why Pakistan chose GS1 standards

GS1 is the global organisation behind the barcodes used in shops worldwide. Using its DataMatrix and application identifiers means the codes on Pakistani medicines can be read by standard scanners and understood in the same way as codes used in many other countries' medicine verification systems. Manufacturers obtain their product numbers (GTINs) by registering with GS1, which is why most local GTINs start with Pakistan's 896 prefix.

Who prints the code

The manufacturer or importer prints the code on each pack before it leaves the factory or warehouse, uploads the serial numbers to DRAP, and checks print quality before dispatch. Pharmacies and patients only read it.

Questions people ask

What is barcode medicine identification?

It is the use of a machine-readable code on a medicine pack to identify the product, and in newer systems the individual box, so it can be checked electronically at each step from factory to patient.

What is the main purpose of barcode medicine identification?

Patient safety. DRAP's guidelines list the aims as increasing patient safety, reducing medication errors, detecting and preventing counterfeit medicines, enabling traceability and rapid recalls, and keeping accurate information flowing between everyone in the supply chain.

What is a GS1 DataMatrix?

A small square 2D barcode that follows GS1 standards. It stores more data than a striped barcode in less space, has built-in error correction so it still reads when slightly damaged, and uses application identifiers so any scanner reads the fields the same way.

What does a GS1 DataMatrix example look like?

Written out, a medicine code looks like (01)08964001282990(17)280923(10)001708(21)02670062528116513679: product number, expiry date, batch and serial.

Does every medicine have a barcode?

In Pakistan, packs manufactured or imported from 9 October 2026 must carry the 2D code. Older stock may have only a striped barcode or none.

What is automated dispensing with barcodes?

In hospitals, barcode identification is also used inside the building: scanning the medicine and the patient's wristband before giving a dose to confirm the right drug, dose and patient.

What is the main purpose of the barcode on medicine?

To identify each pack so it can be verified and traced. DRAP lists patient safety, fewer medication errors, detecting counterfeits, faster recalls and accurate supply-chain information as the aims.

Medicine barcode image: what does it look like?

The 2D code is a small square of black and white dots with a solid L-shaped border on two sides, printed on the carton beside four lines of text: GTIN, SN, BN and EXP.

What is a GTIN?

A Global Trade Item Number: a 14-digit number identifying a product, its strength and its pack size. It is stored after (01) in the code.

Does the barcode contain the price?

No. The code carries the GTIN, batch, expiry and serial. The price is printed separately on the pack and can be checked in our price search.

Scan a pack