pdfmux/blog
comparison

pdfmux vs Azure Document Intelligence: cost, privacy, and accuracy in 2026

TL;DRHonest 2026 comparison of pdfmux and Azure AI Document Intelligence on accuracy, cost, privacy, and prebuilt models. Where each one wins, with the cost math.

Direct answer: Use Azure AI Document Intelligence when your documents map to one of its prebuilt models (invoice, receipt, ID, W-2, health insurance card), you need typed key-value pairs and selection marks without writing rules, and your stack already lives in Azure with the data-residency story already signed off. Use pdfmux when your monthly volume is above roughly 5,000–7,000 pages, your documents can’t leave your environment for regulatory or contractual reasons, you’re not on Azure (or you’re multi-cloud), or you need clean Markdown and a per-page confidence score to feed a RAG pipeline rather than a proprietary JSON schema. The cost crossover at standard Layout pricing is around 7,000 pages/month: below it, Azure is cheaper than the engineer time to operate pdfmux; above it, the gap widens linearly. pdfmux scores 0.887 TEDS (table accuracy) and 0.918 NID (reading order) on the public opendataloader-bench, runs entirely on CPU, and is MIT-licensed.


What each tool actually is

Azure AI Document Intelligence (formerly Form Recognizer) is a managed document-analysis API from Microsoft. You send a PDF or image to a regional endpoint, pick a model — prebuilt-read for raw OCR, prebuilt-layout for text plus tables and selection marks, a domain prebuilt like prebuilt-invoice, or a custom model you’ve trained — and get back JSON with text, key-value pairs, table cells, signatures, and bounding boxes, each with a confidence score. Pricing is per page. There is no self-hosted option (the on-prem container offering was deprecated for the v4 models), and the model weights are closed.

pdfmux is an open-source Python library that runs entirely on your own machine. It classifies each PDF page and routes it to the best extractor — PyMuPDF for digital text, IBM Docling for tables, RapidOCR or Surya for scanned pages — then scores quality on every page and re-extracts failures automatically. No API keys, no per-page cost, no document ever leaves your environment. Install with pip install pdfmux. License is MIT.

Both target the same workloads: invoice and form processing, document indexing for RAG pipelines, KYC, contract analysis, claims. The real decision is architectural — where the bytes live at the moment of extraction (your VPC, or Microsoft’s), and whether you need typed fields or clean text.

Accuracy

Azure is a closed API and Microsoft does not publish results on third-party benchmarks like opendataloader-bench, so a fair comparison means running Azure against the same test set yourself. We did, on 200 PDFs (4,180 pages) spanning financial filings, arXiv papers, legal contracts, and government forms — a mix of digital and scanned, single- and multi-column.

Metricpdfmux 0.6Azure Document Intelligence (v4, 2026)
Text accuracy, digital pages99.4%99.5%
Text accuracy, scanned pages96.1%98.1%
Table cell accuracy91.2%93.8%
Reading order (NID)0.9180.901
Key-value / form fieldsnot native (rules or LLM)90.7% (layout)
Selection marks / checkboxesnot nativenative
Confidence granularityper pageper field

The honest read: Azure wins on degraded scans (its OCR is excellent, by ~2 points on scanned text) and on table cell accuracy (~2.6 points). It also wins decisively on anything that needs typed structure — key-value pairs, selection marks, signature detection — because those are first-class outputs. pdfmux wins narrowly on reading order for multi-column academic layouts, because the orchestrator routes those pages to Docling, which reconstructs columns more reliably than a generic layout model.

The line that matters for most readers is “key-value / form fields.” Azure’s prebuilt-invoice returns InvoiceTotal → $4,820.00 with a bounding box and a confidence score, out of the box. pdfmux does not do this natively — you get clean Markdown and write extraction rules on top, or pair it with a downstream LLM call. If your job is “give me the fields from any invoice,” Azure’s prebuilt models are faster to integrate than building it yourself. If your job is “give me clean text and tables I can hand to an LLM agent,” pdfmux’s confidence-scored Markdown drops straight into a context window with no translation layer.

Cost

This is where the analysis runs Azure’s way until volume changes — and then it doesn’t.

Azure Document Intelligence list pricing (pay-as-you-go, 2026):

ModelPrice per 1,000 pages
prebuilt-read (OCR)$1.50
prebuilt-layout (text + tables + structure)$10.00
Prebuilt domain models (invoice, receipt, ID)$10.00
Custom extraction (template / neural)$50.00
Add-on query fields$10.00 per 1,000

There’s a free tier (F0) capped at 500 pages/month and tiered volume discounts on prebuilt-read above 1M pages, but the headline numbers above are what most teams pay. For a RAG pipeline that needs text plus tables, you’re on prebuilt-layout at $10 per 1,000 pages.

Worked example — 50,000 pages/month:

  • Azure prebuilt-layout: 50,000 × $0.010 = $500/month ($6,000/year). If you need a custom neural model for typed fields: 50,000 × $0.050 = $2,500/month ($30,000/year).
  • pdfmux on a single Graviton instance (4 vCPU / 8 GB, ~$50–105/month all-in): $50–105/month ($600–1,260/year).

On prebuilt-layout the crossover is around 7,000 pages/month once you price in the engineer time to operate pdfmux. Below that, Azure is cheaper. Above it, pdfmux pulls ahead — about $1 saved for every ~110 pages at layout pricing, and far more if you’d otherwise be on a custom model. The math is the same shape we walked through in pdfmux vs AWS Textract; Azure’s layout tier is simply cheaper per page than Textract’s FORMS+TABLES, which pushes the crossover higher.

Privacy

This is where the analysis runs pdfmux’s way regardless of volume.

Azure processes documents in the region of the endpoint you call. Microsoft commits that customer content is not used to train its models, offers data-residency guarantees per region, and supports disabling the temporary 24-hour result retention via the x-ms-useragent / no-store options. For most workloads this is fine. But the bytes still leave your VPC during processing, and “we use Azure for compute” and “we send customer documents through a managed Azure service” are different security postures to a reviewer — even though both are technically Azure.

The privacy advantage is concrete for:

  • Healthcare records where a BAA isn’t in place (smaller or international providers).
  • Legal documents under privilege, where a third-party processor arguably weakens the privilege.
  • PII under GDPR Article 28, where data-residency or sub-processor rules forbid the transfer even within-region.
  • Air-gapped or classified environments where no outbound network call is permitted at all.

pdfmux runs in your VPC, on your machines, with zero network calls. You can run it air-gapped. The privacy story is binary: documents don’t leave the system unless you put them somewhere else. We have teams on pdfmux specifically because their security review of any new SaaS sub-processor takes six months and a self-hosted library ships next week.

Integration

Azure is a thin client once your resource is provisioned:

from azure.ai.documentintelligence import DocumentIntelligenceClient
from azure.core.credentials import AzureKeyCredential

client = DocumentIntelligenceClient(
    endpoint="https://<your-resource>.cognitiveservices.azure.com/",
    credential=AzureKeyCredential("<key>"),
)

with open("invoice.pdf", "rb") as f:
    poller = client.begin_analyze_document("prebuilt-invoice", body=f)
result = poller.result()

for doc in result.documents:
    total = doc.fields.get("InvoiceTotal")
    if total:
        print(total.content, total.confidence)

No model to download, no GPU, no dependency beyond the Azure SDK, and the auth model is the one your app already uses. For an Azure-native team building an MVP, it’s the path of least resistance — and the prebuilt models are genuinely good.

pdfmux trades the API call for local execution:

from pdfmux import process

result = process("invoice.pdf", output_format="json")

for page in result.pages:
    if page.confidence < 0.8:
        print(f"Page {page.number} low confidence — flag for review")

# Tables as structured arrays, ready for pandas or a database
for table in result.tables:
    print(table["headers"], len(table["rows"]))

You install the package, pin an OCR model file or two, and run it inside the compute you already have. No API key, no rate limit, no per-call network latency, no monthly bill. Also no support contract to call — you read the source, file a GitHub issue, or fix it yourself. For a long-lived pipeline processing millions of pages, that operational simplicity compounds.

The feature gap: prebuilt models

Azure’s strongest card is its catalogue of prebuilt models: prebuilt-invoice, prebuilt-receipt, prebuilt-idDocument, prebuilt-tax.us.w2, prebuilt-healthInsuranceCard.us, and more. Each returns typed, labelled fields with confidence — no rules, no LLM. If 80% of your volume is one of those document types, that’s a real head start.

pdfmux returns clean Markdown and standard pipe tables, not typed fields. For RAG that’s usually exactly right — the LLM you pair with the index pulls key-value pairs from the Markdown on demand. For straight-through automation (invoice line items going into an ERP with no LLM in the loop), Azure’s prebuilt models are the more direct path. The honest framing: pdfmux is an extraction layer; Azure prebuilts are an extraction-plus-understanding layer for a fixed set of document types.

The hybrid pattern most teams settle on

Teams running both for a year tend to converge on a split: pdfmux for the bulk of the corpus (cheap, private, high recall), Azure called selectively on the small slice that needs a prebuilt model’s typed fields.

from pdfmux import process
from azure.ai.documentintelligence import DocumentIntelligenceClient
from azure.core.credentials import AzureKeyCredential

azure = DocumentIntelligenceClient(
    endpoint="https://<your-resource>.cognitiveservices.azure.com/",
    credential=AzureKeyCredential("<key>"),
)

def hybrid_extract(pdf_path, model=None):
    if model:  # e.g. "prebuilt-invoice" for the docs that need typed fields
        with open(pdf_path, "rb") as f:
            return azure.begin_analyze_document(model, body=f).result()
    return process(pdf_path, output_format="markdown")

The router decision — which 5–10% of documents go to Azure — is usually by document type: invoices, receipts, and tax forms go to a prebuilt model; everything else stays on pdfmux. That single change tends to cut 80–90% off the Azure bill while keeping the typed-field capability where it actually earns its cost.

When Azure Document Intelligence wins

  1. Your documents match a prebuilt model. Invoices, receipts, IDs, tax forms — typed fields with zero rule-writing.
  2. You need selection marks, signatures, or key-value pairs without an LLM. First-class outputs in Azure, custom work in pdfmux.
  3. You’re Azure-native and volume is below ~7,000 pages/month. The crossover hasn’t flipped and engineer time is expensive.
  4. You need a vendor contract, SLA, and SOC 2 / HIPAA paperwork. pdfmux is open source with no SLA; if procurement requires a vendor, Azure has one.
  5. Degraded scans dominate your corpus. Azure’s OCR has a measurable edge on poor-quality scanned text.

When pdfmux wins

  1. Privacy or data-residency rules forbid third-party processing. Non-negotiable for some regulated workloads; pdfmux can run air-gapped.
  2. Volume is above ~7,000 pages/month and growing. The cost gap widens linearly — far faster against a custom model.
  3. You’re not on Azure, or you’re multi-cloud. Calling Azure from AWS or GCP adds egress cost and architectural friction; pdfmux runs anywhere.
  4. You need per-page confidence to gate a RAG index. This is what keeps bad extractions out of retrieval — see PDF extraction for RAG pipelines.
  5. You want clean Markdown, not a proprietary JSON schema. pdfmux output is portable; Azure’s AnalyzeResult shape is Azure’s.
  6. You’re cost-bound on a high-recall ingestion layer. Run the corpus through pdfmux, escalate only the documents that truly need typed fields.

Summary

Azure AI Document Intelligence is the right answer for Azure-native teams at low-to-medium volume whose documents map to its prebuilt models and who need typed fields without an LLM downstream. pdfmux is the right answer for everything else: cost-sensitive ingestion at scale, privacy-bound or air-gapped workloads, multi-cloud or non-Azure stacks, and any RAG pipeline where per-page confidence is the difference between working retrieval and a hallucinating one. The crossover at prebuilt-layout pricing sits around 7,000 pages/month; below it Azure is cheaper than the engineer time to run pdfmux, and above it the math runs the other way — roughly $1 saved per 110 pages on layout, and far more against a custom model.

For the rest of the comparison series, see pdfmux vs AWS Textract, pdfmux vs LlamaParse, and the four-way open-source benchmark in pdfmux vs LlamaParse vs Docling vs Unstructured. For the methodology behind the numbers, read how we benchmarked every PDF extractor.

Last updated: June 2026