MRZSpain

OCR for Spanish National ID Card - DNI

Complete extraction of Spanish National ID Card data, including MRZ verification and address parsing.

OCR for Spanish National ID Card - DNI
Start in Seconds
Sign up to get your API key and start processing your documents
State of the Art Accuracy
We use the most powerful models to ensure the highest accuracy and throughput
GDPR Compliant
We are EU Hosted, GDPR Compliant and follow Zero Data Retention by default
Just pay for what you extract
No monthly commitments or high starting tiers. Volume discounts available.

Try it out

Experience the power of our OCR. Upload a document and see the results instantly.

Drop document or click to upload

Supports PDF, PNG, JPG (max 10MB)

By uploading a document, you agree to our terms. We do not store your data.

JSON Response
{
"success":
true,
"data":{
"id_number":
"12345678Z",
"id_number_verified":
true,
"document_number":
"BCA12345",
"document_number_verified":
true,
"name":
"JUAN",
"name_verified":
true,
"first_surname":
"GARCIA",
"first_surname_verified":
true,
"second_surname":
"MARTINEZ",
"second_surname_verified":
true,
"birth_date":
"1985-03-15",
"birth_date_verified":
true,
"expiration_date":
"2030-03-15",
"expiration_date_verified":
true,
"issuing_date":
"2020-03-15",
"issuing_team_number":
"08892L6D1",
"gender":
"M",
"gender_verified":
true,
"raw_address":
"CL. MAYOR 12 P02 01 MADRID MADRID MADRID",
"address_road_type":
"CALLE",
"address_road_name":
"MAYOR",
"address_number":
"12",
"address_floor":
"P02",
"address_door":
"01",
"address_province":
"MADRID",
"address_municipality":
"MADRID",
"address_town":
"MADRID",
"mrz_detected":
true
},
"balance":
14.5,
"cost":
0.005
}
id_numberstring | null

Spanish DNI number (DNI)

id_number_verifiedboolean

Whether the DNI control letter has been mathematically verified

document_numberstring | null

The unique document number (Número de soporte)

document_number_verifiedboolean

Whether the document number has been verified against the MRZ

namestring | null

Holder's given name(s) (Nombre)

name_verifiedboolean

Whether the name has been verified against the MRZ

first_surnamestring | null

Holder's first (paternal) surname (Primer apellido)

first_surname_verifiedboolean

Whether the first surname has been verified against the MRZ

second_surnamestring | null

Holder's second (maternal) surname (Segundo apellido)

second_surname_verifiedboolean

Whether the second surname has been verified against the MRZ

birth_datestring | null

Holder's date of birth (Fecha de nacimiento)

birth_date_verifiedboolean

Whether the birth date has been verified against the MRZ

expiration_datestring | null

Date on which the document expires (Fecha de expiración)

expiration_date_verifiedboolean

Whether the expiration date has been verified against the MRZ

issuing_datestring | null

Date on which the document was issued (Fecha de emisión)

issuing_team_numberstring | null

Code identifying the office and team that issued the document (Equipo)

genderstring | null

Holder's gender as a single letter (e.g. M or F) (Género)

gender_verifiedboolean

Whether the gender has been verified against the MRZ

raw_addressstring | null

Full address as it appears on the document, unparsed (Dirección completa)

address_road_typestring | null

Type of road (Tipo de vía)

address_road_namestring | null

Name of the street or road (Nombre de la vía)

address_numberstring | null

Street number (Número)

address_floorstring | null

Floor within the building (Planta)

address_doorstring | null

Door or apartment identifier within the floor (Número de puerta)

address_provincestring | null

Province of the registered address (Provincia)

address_municipalitystring | null

Municipality of the registered address (Municipio)

address_townstring | null

Town or city of the registered address (Población)

mrz_detectedboolean | null

Whether a Machine Readable Zone (MRZ) was detected on the document

Easy to Integrate

Connect our OCR to your application in minutes. We provide ready-to-use fragments for the most popular languages and tools.

Terminal - File Upload
curl -X POST "https://api.tiny-idp.com/api/extractors/run/es-national-id-card" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "files=@/path/to/your/document.jpg"

Ready to build?

Get your free API key and start extracting data from documents in minutes. No credit card required for the free tier.

Common Use Cases

Discover how businesses are using our OCR to automate their workflows.

Automated Onboarding

Extract data from documents to streamline user registration and KYC processes.

Data Verification

Instantly verify document details against your records or third-party databases.

International Documents

Process identity documents from over 190 countries with high accuracy.

Workflow Automation

Eliminate manual data entry by piping structured document data directly into your CRM or ERP.

Enterprise-grade Compliance & Security

We take data privacy seriously. Tiny IDP is built from the ground up to meet the strictest European data protection standards.

Zero Data Retention

We don't store your documents, images, or predictions. Data is processed in-memory and immediately discarded.

GDPR Compliant

Full compliance with European data protection regulations (GDPR) for your peace of mind.

EU-Based Infrastructure

All data is processed and hosted exclusively in secure European data centers.

Visit Trust Center
EU Hosted
Encrypted
No Storage
GDPR

Do you need a custom OCR?

We support custom extractors! Define your own fields, rules, and logic to extract data from any type of document.