What is Amazon Textract?
Every organization processes documents: invoices, receipts, contracts, tax forms, medical records, loan applications and identity documents. Pulling structured data out of them used to mean manual data entry or brittle OCR tools that needed reconfiguring whenever a form layout changed. Amazon Textract, however, replaces both with ML-powered document processing.
Amazon Textract is a fully managed machine learning service from Amazon Web Services that extracts text, handwriting, layout elements and structured data from scanned documents. Traditional OCR only reads characters off a page, while Amazon Textract also understands document structure: it finds tables, forms with key-value pairs, signatures and the relationships between parts of a document.
Give Amazon Textract an invoice, for example, and it reads the text and also works out that “Invoice Number” is a label and “INV-2024-001” is its value. Similarly, it recognizes that a table’s header row holds “Item”, “Quantity” and “Price”, and that the rows below are data belonging to those columns. That understanding of context is what separates intelligent document processing from basic character recognition, and it makes Textract the base for automated document workflows on AWS.
As a result, the efficiency gains can be large. Teams that process documents by hand, keying invoice data into ERP systems, copying medical forms into electronic records or reviewing loan applications page by page, spend a lot of time per document and introduce errors along the way. Textract can process a page in seconds, with a consistency that manual entry struggles to match when thousands of documents arrive each day.
Textract Abilities at a Glance
Amazon Textract accepts PDF, PNG, JPEG and TIFF files. It also handles single-page and multi-page documents, reads printed and handwritten text and returns every extracted element with a confidence score and bounding box coordinates.

Key Takeaway Amazon Textract goes well beyond basic OCR. It understands document structure, including tables, forms, key-value pairs, signatures and layout, and returns structured, machine-readable data from most document types. If your organization processes documents by hand, Textract is a quick route to automation on AWS.
How Amazon Textract Works
Amazon Textract runs as a serverless API. You send a document, stored in S3 or as raw bytes, choose the type of analysis and get structured JSON back, with every detected element’s text, confidence score and position on the page.
Textract’s pre-trained models work on most documents without templates or configuration. In addition, AWS keeps improving the models, so accuracy can improve over time without any work on your side.
Textract API Overview
Amazon Textract provides several specialized APIs, each built for a different document task:
- DetectDocumentText: The simplest API, which extracts all text as words and lines. It is plain OCR, but deep learning gives it better accuracy on hard inputs such as handwriting, low-quality scans and noisy backgrounds.
- AnalyzeDocument: The core API. It extracts text plus structure: tables (rows, columns and cells), forms (key-value pairs and checkboxes), signatures and layout elements such as paragraphs, titles, headers, footers and lists. This is where Textract’s grasp of structure sets it apart from basic OCR.
- Queries: A feature of AnalyzeDocument that lets you ask natural language questions about a document, such as “What is the patient name?” or “What is the due date?”, and get precise answers. In addition, it is pre-trained on paystubs, bank statements, W-2s, loan applications, mortgage notes and insurance cards.
- AnalyzeExpense: Built for invoices and receipts. It identifies vendor names, even from logos without labels, along with line items, quantities, prices and totals, and returns normalized field names so different invoice formats can be processed the same way.
- AnalyzeID: Built for identity documents. It extracts data from U.S. passports and driver’s licenses without templates, which supports automated identity verification, account opening and KYC workflows.
- Analyze Lending: A managed workflow for mortgage loan packages. It classifies pages into document types, such as W-2s, paystubs, bank statements and tax returns, sends each to the right extraction API and returns consolidated results for the whole package.
Synchronous vs Asynchronous Textract Processing
Amazon Textract offers two processing modes. Synchronous APIs (DetectDocumentText, AnalyzeDocument) process single-page documents in real time and return results immediately, which suits interactive apps where a user uploads a document and expects instant feedback. Asynchronous APIs (StartDocumentTextDetection, StartDocumentAnalysis), by contrast, handle multi-page documents as jobs and notify you through SNS when results are ready, which suits batch pipelines and large document workflows.
For production, the most common design combines S3 event notifications with Lambda. When a document lands in a bucket, Lambda starts the Textract analysis, processes the results and stores the extracted data in DynamoDB, RDS or Amazon OpenSearch for other applications. This event-driven pattern scales on its own and needs no infrastructure management.
For high-volume processing, AWS also publishes Intelligent Document Processing (IDP) CDK constructs: templates that deploy a full pipeline with S3 ingestion, SQS queuing to manage throttling, Lambda orchestration, Textract analysis and result storage. They build in exponential backoff with jitter, error handling, dead-letter queues for failed documents and CloudWatch dashboards, which saves weeks of pipeline work.
Textract also worked with Amazon Augmented AI (A2I) for human review: when a confidence score fell below your threshold, A2I sent the document to a reviewer, and the corrected data flowed back into the pipeline. A2I moved to maintenance mode and closed to new customers on July 30, 2026, so new projects should build their own review step, for example a queue of low-confidence results in a simple internal review tool. Human review still matters wherever extraction errors carry business or compliance risk.
Custom Queries for Textract
You can also customize the pre-trained Queries feature with your own documents. In the AWS Console, you upload a small set of sample documents, annotate the fields you need and train an adapter. This helps with industry-specific documents where pre-trained models may miss specialized fields, such as GST numbers on Indian invoices or policy numbers on your own insurance documents.
Custom Queries keep your data private during training. Your training documents and annotations stay in your AWS account, and the resulting adapter is private to your organization. It works alongside Textract’s pre-trained features, so you can use standard and custom Queries in the same API call.
Core Amazon Textract Features
Beyond the APIs above, several features make Amazon Textract suited to enterprise document processing. Together they handle most document types, from simple one-page forms to long financial reports with nested tables and a mix of handwritten and printed content:
Amazon Textract Pricing Model
Fundamentally, Amazon Textract uses pay-per-page pricing with no minimum commitments. Rather than listing specific dollar amounts that change over time, here is how the cost structure works:
Understanding Textract Cost Dimensions
- Pages processed: Charged per page, with a separate rate for each API. DetectDocumentText (plain OCR) is the cheapest, AnalyzeDocument costs more because of its structural analysis, and AnalyzeExpense and AnalyzeID have their own per-page rates.
- Feature combinations: In AnalyzeDocument, you can turn on several features per call, such as tables, forms, queries, signatures and layout. Each one adds to the per-page cost, so enable only what each document type needs.
- Volume tiers: Per-page prices fall as monthly volume rises, so high-volume workflows benefit from the tiered pricing.
- Custom Queries: Documents processed with a custom adapter are charged at their own per-page rate.
Match the API to the task. If you only need raw text, use DetectDocumentText and skip AnalyzeDocument’s structural analysis. For invoices, use AnalyzeExpense, which returns normalized fields, instead of generic AnalyzeDocument. And classify documents first, so each goes to the cheapest API that can handle it. For current prices by API and tier, see the official Textract pricing page.
Amazon Textract Security and Compliance
Textract processes sensitive business documents, such as financial records, identity documents, medical forms and legal contracts, so security matters.
Textract Data Protection
Data processed by Amazon Textract is encrypted in transit with TLS and at rest with AWS KMS. Textract supports interface VPC endpoints through AWS PrivateLink, so document traffic can stay off the public internet, and IAM policies control which users and applications can call the APIs. AWS may store and use content processed by Textract to improve the service, unless you opt out through an AWS Organizations AI services opt-out policy.
For data residency, Textract processes documents in the AWS Region where you call the API. Combined with S3 bucket policies, KMS keys and IAM controls, that keeps sensitive document data inside the security boundary you define.
Amazon Textract is HIPAA eligible, so healthcare organizations can use it for medical records, insurance claims and patient intake forms that contain protected health information. It is also covered by AWS compliance programs such as SOC, PCI DSS and ISO 27001, which helps financial services firms processing loan documents, invoices and tax forms meet their compliance obligations.
What’s New in Amazon Textract
AWS keeps updating Amazon Textract. The Layout feature, for example, extracts paragraphs, titles, headers, footers and lists while keeping the reading order and hierarchy of complex documents. That helps downstream NLP and content management, where structure and reading order matter as much as the raw text.
Custom Queries adapters let organizations tune extraction with a small set of annotated samples, so domain-specific processing does not need ML expertise. Together with the pre-trained Queries, which cover paystubs, bank statements, W-2s, loan application forms, mortgage notes, claims documents and insurance cards, they let one API handle standard and proprietary formats.
Textract has also improved handwriting recognition and support for pages that mix printed and handwritten text. In healthcare, insurance and government, where handwritten notes on printed forms are common, this reduces manual review and correction.
Real-World Amazon Textract Use Cases
Amazon Textract serves organizations in every industry that handles paper or digital documents, from banks processing loan applications to healthcare organizations digitizing decades of patient records. These are the use cases we implement most often for enterprise clients:
Amazon Textract vs Azure AI Document Intelligence
If you are comparing document processing services across cloud providers, here is how Amazon Textract compares with Microsoft’s Azure AI Document Intelligence (formerly Form Recognizer):
| Ability | Amazon Textract | Azure AI Document Intelligence |
|---|---|---|
| Core OCR | Yes: DetectDocumentText with deep learning | Yes: Read API with advanced OCR |
| Table Extraction | ✓ Preserves full table structure | Yes: Table extraction with cell merging |
| Form Key-Value Pairs | ✓ Automatic without templates | Yes: Pre-built and custom models |
| Natural Language Queries | ✓ Ask questions in plain English | ◐ Field extraction with labels |
| Invoice Processing | Yes: AnalyzeExpense with normalization | ✓ Pre-built invoice model |
| ID Document Processing | Yes: AnalyzeID (U.S. documents) | ✓ Broader international ID support |
| Lending / Mortgage | ✓ Analyze Lending managed workflow | ◐ Prebuilt mortgage document models |
| Custom Model Training | Yes: Custom Queries adapters | Yes: Custom models with labeling |
| Handwriting Recognition | Yes: Mixed print and handwriting | Yes: Mixed print and handwriting |
| Language Support | ◐ 6 languages (EN, ES, DE, FR, IT, PT) | ✓ Many more languages for print OCR |
Choosing the Right Textract Alternative
Both services are mature, so your cloud ecosystem usually decides. On AWS, Textract’s native links to S3, Lambda and SQS make it the natural choice for automated document pipelines. On Azure, Document Intelligence integrates natively with Azure Blob Storage, Logic Apps and Azure AI services.
Azure offers prebuilt models for common U.S. mortgage documents, while Textract’s Analyze Lending adds a managed workflow that classifies and extracts a whole loan package in one go, which matters for lenders automating loan origination. Textract’s natural language Queries also make ad hoc extraction easier than label-based field extraction.
Azure has clear advantages in two areas. First, languages: Azure’s OCR covers many more languages than Textract’s six, which matters for global organizations with multilingual documents. Second, identity documents: Azure recognizes IDs from many countries, while Textract’s AnalyzeID covers U.S. passports and driver’s licenses.
AWS teams that need more languages can use a hybrid approach: Textract for documents in its supported languages, where its structural understanding is strongest, and Amazon Bedrock with multimodal models for other languages.
Getting Started with Amazon Textract
Amazon Textract needs no setup: the pre-built APIs have no models to deploy or train. You call the API with a document and get structured results right away. The free tier gives enough pages to test your use case before you commit to production spending.
Your First Textract API Call
Here is a minimal Python example that extracts text from a document stored in S3:
import boto3
# Initialize the Textract client
client = boto3.client('textract', region_name='us-east-1')
# Extract text from a document in S3
response = client.detect_document_text(
Document={
'S3Object': {
'Bucket': 'my-documents',
'Name': 'invoices/invoice-001.pdf'
}
}
)
# Print extracted lines of text
for block in response['Blocks']:
if block['BlockType'] == 'LINE':
print(f"{block['Text']} ({block['Confidence']:.1f}%)")
For structured extraction of tables, forms and queries, replace detect_document_text with analyze_document and specify the feature types you need. For invoices, use analyze_expense, and for identity documents, analyze_id. Each API returns structured JSON with confidence scores and bounding boxes for every element. For more details and patterns, see the Amazon Textract documentation.
Amazon Textract Best Practices and Pitfalls
Recommendations for Textract Deployment
- Classify documents before processing: Send each document type to the most suitable API: invoices to AnalyzeExpense, IDs to AnalyzeID and general forms to AnalyzeDocument. That improves accuracy and lowers cost, because each API is tuned for its document type.
- Set confidence thresholds for your use case: Textract returns a confidence score for every element. For high-stakes work such as financial processing and compliance, send low-confidence extractions, for example below 95%, to human review instead of processing them automatically. For lower-stakes work such as search indexing, a lower threshold, say 80%, may be enough.
- Add retry logic with exponential backoff: Textract enforces per-account rate limits in transactions per second. Use exponential backoff with jitter to handle throttling, especially in large batch runs. The AWS IDP CDK constructs include these patterns.
Architecture and Validation Best Practices
- Use asynchronous APIs for multi-page documents: Synchronous APIs handle single-page documents only. For multi-page PDFs, use the asynchronous Start and Get pattern with SNS notifications, so your application is not blocked. Queue documents in SQS to smooth traffic and stay within rate limits.
- Validate extracted data against business rules: ML extraction is accurate but not perfect. Check that dates are valid, totals match line items, required fields are present and number formats are consistent, so errors are caught before they reach ERP, CRM or compliance systems.
Key Takeaway Amazon Textract turns manual document processing into automated, scalable pipelines, extracting structured data from invoices, forms, IDs and loan packages through purpose-built APIs. Successful deployments match the right API to each document type, set sensible confidence thresholds and validate extracted data against business rules. An experienced AWS partner can help you design document processing architectures that raise accuracy while keeping costs down.
Frequently Asked Questions About Amazon Textract
Technical and Integration Questions
References
- APIs, Supported Languages and Formats, Queries and Adapters: AWS — Amazon Textract Developer Guide
- Per-Page Pricing by API and Tier: AWS — Amazon Textract Pricing
- SageMaker A2I Moving to Maintenance (Closed to New Customers July 30, 2026): AWS What’s New — AWS Service Availability Updates, June 2026
Security Insights, Delivered.
Practical, vendor-neutral analysis of threats, tools, and architecture decisions.
