Automatically detect and redact passport numbers from 190+ countries with intelligent format recognition, issuing country identification, and validation algorithms.
Global coverage with intelligent validation
Detect passport numbers from 190+ countries with country-specific format recognition and validation rules.
Validate passport formats against ICAO standards and country-specific rules to minimize false positives.
Automatically identify the issuing country based on passport format and contextual clues.
Extract and redact passport data from Machine Readable Zone (MRZ) in scanned documents and images.
Distinguish passport numbers from similar alphanumeric patterns using contextual analysis.
Support GDPR, travel industry regulations, and immigration data protection requirements.
Simple integration, powerful results
Send your documents, text, or files through our secure API endpoint or web interface.
Our AI analyzes content to identify all sensitive information types with 99.7% accuracy.
Sensitive data is automatically redacted based on your configured compliance rules.
Receive your redacted content with full audit trail and compliance documentation.
Get started with just a few lines of code
import requests
api_key = "your_api_key"
url = "https://api.redactionapi.net/v1/redact"
data = {
"text": "John Smith's SSN is 123-45-6789",
"redaction_types": ["ssn", "person_name"],
"output_format": "redacted"
}
response = requests.post(url,
headers={"Authorization": f"Bearer {api_key}"},
json=data
)
print(response.json())
# Output: {"redacted_text": "[PERSON_NAME]'s SSN is [SSN_REDACTED]"}
const axios = require('axios');
const apiKey = 'your_api_key';
const url = 'https://api.redactionapi.net/v1/redact';
const data = {
text: "John Smith's SSN is 123-45-6789",
redaction_types: ["ssn", "person_name"],
output_format: "redacted"
};
axios.post(url, data, {
headers: { 'Authorization': `Bearer ${apiKey}` }
})
.then(response => {
console.log(response.data);
// Output: {"redacted_text": "[PERSON_NAME]'s SSN is [SSN_REDACTED]"}
});
curl -X POST https://api.redactionapi.net/v1/redact \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"text": "John Smith's SSN is 123-45-6789",
"redaction_types": ["ssn", "person_name"],
"output_format": "redacted"
}'
# Response:
# {"redacted_text": "[PERSON_NAME]'s SSN is [SSN_REDACTED]"}
Passports represent the most universally recognized form of identification, carrying extraordinary sensitivity as both identity documents and travel credentials. A passport number, combined with even minimal additional information, enables identity theft, fraudulent travel document creation, and unauthorized border crossings. In an era of digital travel records, electronic visa applications, and online booking systems, passport data appears in countless documents, emails, and databases—each instance creating potential exposure.
The challenge of passport number detection extends far beyond simple pattern matching. With 190+ countries issuing passports in varying formats, from purely numeric sequences to complex alphanumeric patterns with check digits, accurate detection requires sophisticated understanding of international standards and country-specific variations. Our passport redaction technology combines ICAO standard compliance with machine learning to achieve reliable detection across all passport types while minimizing false positives from similar data patterns.
The International Civil Aviation Organization (ICAO) establishes standards for travel documents through Document 9303, but implementation varies significantly by country. Understanding these variations is essential for accurate detection:
United States Passports: US passport numbers consist of 9 digits, though older passports used different formats. The number appears on the data page and in the Machine Readable Zone (MRZ). Current US passports follow a specific numbering sequence, though the algorithm is not publicly documented for security reasons.
United Kingdom Passports: UK passport numbers contain 9 characters—typically starting with digits, though formats have evolved over the years. Post-2010 passports follow a specific pattern, while older burgundy passports used different formats. Our detection handles all UK passport generations.
European Union Passports: EU member states maintain their own passport numbering systems while adhering to EU travel document standards. German passports use 10 characters with a specific structure. French passports use 9 characters. Each country has distinct patterns that our system recognizes.
Asian Passports: Countries like China, Japan, and India use varying formats. Chinese passports use letter prefixes indicating passport type (G for regular, D for diplomatic) followed by 8 digits. Japanese passports use two letters and seven digits. Indian passports use a letter followed by seven digits.
Modern passports include a Machine Readable Zone—two or three lines of text at the bottom of the data page containing encoded passport information. The MRZ follows ICAO 9303 standards and contains highly sensitive data:
MRZ data appears in scanned passport images, travel system databases, airline records, and immigration documents. Our OCR-powered detection can extract and redact MRZ data from images while also recognizing MRZ patterns when they appear in text form (such as in booking confirmations or visa applications).
Check digits within the MRZ provide validation opportunities. Each sensitive field has an associated check digit calculated using a standard algorithm. We verify these check digits to confirm valid passport data, reducing false positives from random character sequences that happen to match MRZ patterns.
Passport numbers often share characteristics with other identifiers—account numbers, reference codes, serial numbers. A nine-digit sequence could be a US passport, a phone number, or an order ID. Context analysis enables accurate classification:
Proximity Keywords: Terms like "passport," "travel document," "passport number," "passport no.," or country names near a number sequence strongly indicate passport data. Our system weights these contextual signals in classification decisions.
Document Type: Certain document types have higher passport number probability. Visa applications, travel itineraries, immigration forms, and hotel registration documents warrant heightened sensitivity for passport detection.
Format Consistency: When multiple identifiers appear together (passport number, nationality, dates), the pattern strongly suggests passport data. A nine-digit number appearing with a country code and date format typical of birth dates likely represents passport information.
Structural Position: In forms and structured documents, passport numbers typically appear in specific fields or after specific labels. Our detection uses document structure understanding to identify passport number locations.
Our passport detection covers formats from every passport-issuing entity worldwide. This comprehensive coverage is essential for organizations processing international data:
North America: United States (9 digits), Canada (2 letters + 6 digits), Mexico (9 digits with letter prefixes for passport type).
Europe: Each EU/EEA country maintains distinct formats. Germany (10 alphanumeric), France (9 characters), Italy (2 letters + 7 digits), Spain (3 letters + 6 digits), Netherlands (9 alphanumeric). UK post-Brexit continues previous format.
Asia-Pacific: China (letter + 8 digits), Japan (2 letters + 7 digits), South Korea (letter + 8 digits), Australia (letter + 7 digits), India (letter + 7 digits), Singapore (letter + 7 digits).
Middle East: United Arab Emirates, Saudi Arabia, Israel, and other nations each use specific formats that our system recognizes and validates.
Latin America: Brazil (2 letters + 6 digits), Argentina (3 letters + 6 digits), and other countries have distinct patterns documented in our detection rules.
Beyond regular passports, various special travel documents require protection:
Diplomatic Passports: Issued to diplomats and government officials, these often use different numbering sequences or prefixes. Their sensitivity is heightened due to the bearer's official status.
Service/Official Passports: Government employees traveling on official business may carry service passports with distinct formats from regular passports.
Emergency Travel Documents: Temporary passports issued to citizens abroad who have lost their passports use simplified formats but still require protection.
Refugee Travel Documents: Issued under the 1951 Convention, these documents enable refugee travel and use specific formats that our system recognizes.
Laissez-Passer: Emergency travel documents issued by governments or international organizations when standard passports are unavailable.
Passport data appears across numerous industries, each with specific protection requirements:
Travel and Hospitality: Airlines, hotels, cruise lines, and tour operators collect passport data for bookings, check-ins, and regulatory compliance. This data flows through reservation systems, confirmation emails, and partner integrations—each touchpoint requiring protection.
Financial Services: Know Your Customer (KYC) requirements mean banks, investment firms, and money transfer services collect passport copies. These images and extracted data require redaction for non-essential uses.
Immigration and Legal: Law firms handling immigration cases process passport information extensively. This data appears in applications, correspondence, and case files requiring careful management.
Healthcare: International patients provide passport identification. Medical tourism, international insurance claims, and cross-border care all involve passport data requiring HIPAA and GDPR-compliant protection.
Education: International students provide passport information for visa sponsorship, enrollment, and housing. Universities must protect this data under FERPA and applicable privacy laws.
Passport data protection intersects with multiple regulatory frameworks:
GDPR: As government-issued identifiers, passport numbers qualify as personal data under GDPR. Processing requires legal basis, and data minimization principles encourage redaction when the full number isn't needed.
Travel Industry Regulations: IATA standards, airline security requirements, and customs/border protection rules govern passport data handling in travel contexts.
Financial Regulations: KYC requirements mandate passport collection but also require appropriate safeguards. FINRA, SEC, and banking regulators expect proper protection of identity documents.
Data Breach Notification: Passport numbers typically trigger notification requirements under breach laws, making prevention through redaction preferable to remediation after exposure.
Physical passports are frequently photographed or scanned, creating images containing sensitive data. Our image processing capabilities handle these visual documents:
Data Page Extraction: The main passport page contains the photo, personal details, and MRZ. OCR extracts all text for analysis, while visual detection identifies the photo region.
Visa Pages: Passport stamps and visas contain travel history, entry/exit dates, and immigration officer details that may require redaction.
Full Document Scans: When entire passports are scanned, all pages require analysis for sensitive content—not just the data page.
Quality Handling: Our OCR handles varying image qualities—phone photos, scans, faxes—with preprocessing to enhance accuracy on challenging images.
Different use cases require different redaction approaches for passport data:
Full Redaction: Replace the entire passport number with [PASSPORT_REDACTED] or similar marker. Appropriate when no reference to the original is needed.
Partial Masking: Show only the last few characters (e.g., ****5678) to enable verification while protecting the full number. Useful for customer service scenarios.
Tokenization: Replace with a consistent token that enables data linking without exposing the actual number. Essential for analytics and research use cases.
Country Preservation: Redact the number while preserving country information for demographic analysis (e.g., [US_PASSPORT_REDACTED]).
RedactionAPI has transformed our document processing workflow. We've reduced manual redaction time by 95% while achieving better accuracy than our previous manual process.
The API integration was seamless. Within a week, we had automated redaction running across all our customer support channels, ensuring GDPR compliance effortlessly.
We process over 50,000 legal documents monthly. RedactionAPI handles it all with incredible accuracy and speed. It's become an essential part of our legal tech stack.
The multi-language support is outstanding. We operate in 30 countries and RedactionAPI handles all our documents regardless of language with consistent accuracy.
Trusted by 500+ enterprises worldwide





Each country has specific passport number formats—the US uses 9 digits, UK uses 9 alphanumeric characters, Germany uses 10 characters with specific patterns. Our detection engine includes format rules for 190+ countries based on ICAO standards and country-specific documentation. Context clues help identify the issuing country when format alone is ambiguous.
Yes, we can extract and redact passport information from MRZ lines found in scanned passports and travel documents. The MRZ contains the passport number, nationality, date of birth, expiration date, and other sensitive data in a standardized format. We detect and redact all sensitive MRZ fields.
For text documents, we use pattern matching with country-specific validation. For images of passports, we use OCR to extract text including MRZ data, then apply the same detection logic. Visual redaction can blur or black-box the passport number, MRZ, and photo as needed.
Expired passport numbers still require protection—they remain valid identifiers that can be used for identity fraud or tracking. We detect passport numbers regardless of validity status. If you have expiration date information, rules can distinguish active from expired documents.
Passport formats often overlap with other identifiers. We use multiple validation layers: format validation against country rules, check digit verification where applicable, context analysis (looking for travel-related terms), and machine learning models trained on real passport data patterns.
Yes, we detect all passport types including regular, diplomatic, service/official, and emergency travel documents. Some countries use different formats for different passport types—our detection covers these variations.