TECHNOLOGY

OCR vs OCV: Verifying Batch Numbers and Expiry Dates on Packs

A wrong or unreadable batch code can derail a recall or put expired medicine on shelves. Learn the difference between OCR and OCV, and how to choose code verification for pharma and food packs.

Daxesh Patel
23 Oct 2026
8 min read
On 27 November 2026, the last major exemption under the US Drug Supply Chain Security Act (DSCSA) expires. From that date, small pharmacies must also be ready for interoperable, electronic, package-level product tracing (FDA exemption letter). Earlier exemptions ended for manufacturers and repackagers in May 2025, wholesale distributors in August 2025 and larger dispensers in November 2025 (Pharmacy Times).

That tracing depends on one simple thing being right on every pack: the printed lot number and expiry date. Indian exporters supplying the US, and every plant printing batch codes for domestic markets, therefore face the same question. How do you prove every printed code is correct and readable? The answer lies in machine vision, and in understanding OCR vs OCV.

Why code verification matters

A wrong or unreadable code causes problems far beyond the packing line:
  • Recalls: if a batch number is wrong, a recall may miss affected packs or pull good ones.
  • Expired product in the market: a mistyped expiry date can keep expired medicine on shelves.
  • Complaints and rejections: distributors and pharmacies may reject packs whose codes do not match their documents.
  • Traceability failure: under serialisation systems such as DSCSA, the human-readable lot and expiry must match the 2D Data Matrix data.
Most of these errors start with a simple cause: the wrong job loaded on the printer, a smudged print, a missing character or a printer that ran out of ink.

OCR explained

OCR (Optical Character Recognition)
reads printed characters and converts them into text the system can use.

A camera captures the code. The software finds each character, recognises it and returns a string such as "B2611A EXP 10/2028". That string is then compared against the expected value from the job or batch record.

OCR answers the question: "What does this code say?"

OCR is ideal when:
  • You need the actual text for records, reports or a database.
  • Codes change often, such as serial numbers or time stamps.
  • You want to compare the printed text with data from an ERP or MES.

OCV explained

OCV (Optical Character Verification)
checks that the printed code matches a known, expected code, and that each character is printed well enough.

The system is taught a good example of each character. During production, it confirms that every character is present, correct and of acceptable quality.

OCV answers the question: "Is this the right code, printed properly?"

OCV is ideal when:
  • The code is fixed for the whole batch, such as batch number and expiry date.
  • Print quality matters as much as content.
  • You need very high speed with very low false rejects.
In practice, most modern systems run both. TCT's OCR Verification System reads and verifies batch codes (OCR/OCV), 1D barcodes, 2D Data Matrix and QR codes, and pharma codes with a single camera, at up to 1,200 products per minute. TCT's Marking & Inspection System goes a step further for vials: it prints the batch code on aluminium seals with a CIJ printer and then verifies every code with OCR/OCV at up to about 200–220 vials per minute.

Print quality factors

The best vision system cannot read a code that was never printed well. The printing method strongly affects verification results.

TCT's OCR system detects smudges, streaks, incorrect information, ink spots, low-contrast print, drag-out and colour variation. It supports fonts including OCR-A/B, dot-matrix, industrial, pharma and MICR.

Good practice for reliable verification:
  • Keep print position consistent, using encoder-based synchronisation.
  • Choose fonts and sizes the vision system is trained on.
  • Use stable, diffused lighting to avoid glare on shiny seals and foils.
  • Validate with deliberately bad samples (a challenge test) at each changeover.
[Insert example images: a good code, a smudged code, a missing character and a wrong
batch number, each with the system's result.]

Rejects and audit trail

Finding a bad code is only half the job. Regulated lines must also prove what happened to every reject.
A compliant verification system should provide:
  • Positive rejection with a locked reject bin.
  • Rejected image storage, so QA can review each failed code.
  • Batch-wise reports that cannot be edited.
  • User access control with password policies and lockouts.
  • Audit trail of every parameter change and login.
TCT's systems use 21 CFR Part 11 compliant software. The Marking & Inspection System includes TrueVISION software with recipe management, rejected image management, user access management, audit trail and electronic records.

Frequently asked questions

What is the difference between OCR and OCV?
OCR reads the printed characters and tells you what they say. OCV confirms that the printed code matches the expected code and is printed to the required quality.
Which is better for batch numbers and expiry dates? OCV, because these codes are fixed for the batch. Many lines use OCR and OCV together.
Can one camera check text and barcodes? Yes. TCT's OCR system checks OCR/OCV text, 1D barcodes, 2D Data Matrix, QR and pharma codes with a single camera.
How fast can OCR verification run? TCT's OCR Verification System runs at up to 1,200 products per minute, depending on the application.
Is OCR/OCV software 21 CFR Part 11 compliant? TCT's software is 21 CFR Part 11 compliant, with audit trails, access control and non-editable reports.

Get every code right, every time
Talk to a TCT application engineer about which technology fits your product.

Daxesh Patel

READY TO DEPLOY

Find the Right Detection System for Your Line

Talk to our application engineers. We'll review your product specifications, HACCP requirements, and compliance obligations — and recommend the optimal inspection and detection strategy.
24h Response Time
200+ Sites Served
ISO Certified Facility
15+ Years Experience