Optical Character Recognition for European Union identity documents: reads the MRZ, QR codes and barcodes of ID cards that follow the ICAO 9303 standard.
Ocrideu is a JavaScript/Node.js library that extracts the machine-readable information from European (EU/EEA) identity documents. It performs Optical Character Recognition on the Machine-Readable Zone (MRZ) and also reads the QR codes and barcodes found on the document, following the ICAO 9303 standard for TD1-size cards.
It is most useful with a picture of the back of an identity card, because that is where European documents carry their machine-readable data. Before reading, the library automatically rotates the image upright, optimises it for clarity, crops it to the document borders and corrects the most common OCR mistakes.
npm i @tuchsoft/ocrideuimport { parse } from '@tuchsoft/ocrideu';
import { readFileSync } from 'fs';
const image = readFileSync('id-card-back.jpg');
const result = await parse(image);
console.log(result.mrz);
console.log(result.barcodes, result.qr);The parse() function accepts a Buffer and an optional options object that controls MRZ correction, image optimisation, and barcode scanning. Every behaviour can be tuned or turned off, and the return value includes timing metrics and image hashes if you need them.
The result includes the parsed MRZ fields (document number, issuing state, birth and expiry dates, name), the detected barcodes and QR codes, the detected side of the document, and optional hashes and execution data. It relies on proven building blocks such as Tesseract.js, OpenCV, @zxing/library, Quagga2 and the mrz parser.
Ocrideu does not read the human-readable fields and does not validate or verify the authenticity of a document. Its only job is to parse the machine-readable data that is already printed on the card, which makes it a fast first step for onboarding, form pre-filling and identity-data capture workflows, never a replacement for a real identity check.