Best LLM for Invoice Extraction
Aug 10, 2026
Try it now: upload an invoice and get the data in Excel or CSV
PDF, JPG, PNG, BMP, HEIC, TIFF
Upload your invoices
Drop files here or click to upload
Up to 50 files
Uploading...
Short answer: it depends on one question, and it is not the one most people ask. If you only need header fields (vendor, invoice number, date, total), GPT-4o with an OCR pre-pass is the most accurate option independently tested, at 98 percent field accuracy. If you need line items, no general-purpose LLM tested has come close to a purpose-built model: the best LLM score is 63 percent against 87 percent for Azure Document Intelligence. On cost, Gemini 2.5 Flash-Lite is the cheapest at roughly $0.27 per 1,000 pages, with GPT-5 mini at about $2.06. So the model you pick should follow from whether your workflow needs the table rows, not from which model tops a general leaderboard.
That is the whole decision in a paragraph. The rest of this article shows the numbers behind it, because the benchmarks that get quoted in this space are usually quoted with the inconvenient column removed.
What the independent accuracy data actually says
The most useful public benchmark on invoice extraction specifically comes from Businessware Technologies, published January 2025. They scored five tools against human-verified ground truth using scanned invoices in JPG, PNG and PDF without text layers, spanning at least three layout types and documents issued between 1971 and 2020. That is a deliberately hard dataset, which matters when you read the numbers.
| Tool | Field accuracy | Line-item extraction |
|---|---|---|
| GPT-4o with third-party OCR | 98.0% | 57.0% |
| Azure Document Intelligence | 93.0% | 87.0% |
| GPT-4o with image input | 90.5% | 63.0% |
| Google Document AI | 82.0% | 40.0% |
| AWS Textract | 78.0% | 82.0% |
Look at the first row on its own and the LLM wins outright. Look at both columns and the story inverts. GPT-4o with an OCR pre-pass beats Azure by five points on header fields and Textract by twenty, then finishes second from last on line items, thirty points behind Azure.
This is not a flaw in GPT-4o so much as a description of what these tools are. A general language model reads text extremely well and reasons about the geometry of a table poorly. It does not know that the number sitting 400 pixels right of a description belongs to that description rather than the row below it, and nothing in its training made that association reliable. A prebuilt invoice model was trained on exactly that association and little else.
Businessware ran a second round in March 2025 across seven solutions, adding Gemini 2.0 Pro Experimental and DeepSeek v3, using 20 invoices from 2006 to 2020 and 16 standardized fields. Their findings there: Gemini showed the highest detailing capability and extracted extended fields accurately when prompted, outperforming both GPT-4o and DeepSeek. GPT-4o on image input performed strongly with occasional inaccuracies in numeric values. DeepSeek showed lower reliability, with frequent errors in both text and numbers. Google Document AI failed to produce structured item breakdowns at all, which makes it unsuitable for an automated workflow regardless of its header scores.
Two caveats before you build a budget on any of this. Both rounds are from 2025, and every vendor has shipped model updates since, OpenAI and Google most aggressively. And the second round used only 20 invoices, which is enough to reveal a pattern and not enough to separate models that finish within a few points of each other.
How much does LLM invoice extraction cost per 1,000 pages?
None of these vendors sell OCR by the page. You are billed for tokens, so the page price is something you derive. The figures below assume a US Letter page scanned at 150 DPI (1,275 by 1,650 pixels), high detail, a 200-token instruction prompt, and roughly 700 output tokens, which is about what a header plus ten line items comes to in JSON.
| Model | Cost / 1,000 pages | With batch discount |
|---|---|---|
| Gemini 2.5 Flash-Lite | $0.27 | Varies by tier |
| GPT-5 nano | $0.47 | $0.24 |
| Gemini 2.5 Flash | $1.58 | Varies by tier |
| GPT-5 mini | $2.06 | $1.03 |
| Mistral OCR 4 | $4.00 | $2.00 |
| Gemini 2.5 Pro | $6.32 | Varies by tier |
| GPT-4.1 | $7.53 | $3.76 |
| GPT-5 | $9.12 | $4.56 |
| GPT-4o | $9.41 | $4.71 |
| AWS Textract Analyze Expense | $10.00 | Not offered |
| Azure prebuilt-invoice | $10.00 | Not offered |
| GPT-5.5 | $29.48 | $14.74 |
Gemini looks dramatically cheaper than OpenAI at similar tiers, and there is a concrete reason for it rather than a pricing gimmick. Google bills a document page at a flat 258 tokens. OpenAI bills the same page at 765 tokens on the tile-based models or 1,496 patches on the GPT-5 family. Same paper, roughly three to six times the input tokens. If you want the full derivation for the OpenAI side, we published the token math on our OpenAI OCR pricing page, and the Google equivalent sits on the Gemini OCR pricing page.
The other thing worth internalizing: on every OpenAI model in that table, the JSON you ask back accounts for 59 to 77 percent of the request cost, because output is billed at four to eight times the input rate. Teams trying to cut costs almost always downscale their scans first. Trimming unused fields out of the response schema saves considerably more.
Which LLM is best for invoice extraction?
Matching the data above to real situations:
- Header fields only, high volume: Gemini 2.5 Flash-Lite or GPT-5 nano. At $0.27 and $0.47 per 1,000 pages you can afford to run two models and compare their answers, which is a cheap and surprisingly effective accuracy trick.
- Header fields plus a reliable general default: GPT-5 mini at about $2.06, or Gemini 2.5 Flash at $1.58. Both read dense pages well and neither will surprise you on the bill.
- Line items required: a purpose-built model rather than an LLM. Azure Document Intelligence at 87 percent is the strongest tested, Textract at 82 percent is close behind, and both cost a flat $10.00 per 1,000 pages with the fields already typed and grouped.
- Mixed or unusual document types: an LLM, because one prompt change handles a purchase order, a delivery note, or a handwritten receipt. A prebuilt invoice model cannot, and training a custom one needs labeled data you probably do not have.
- Frontier reasoning models: skip them for this. GPT-5.5 costs 14 times GPT-5 mini per page and reading an invoice does not need frontier reasoning.
Can an LLM extract invoice line items reliably?
Not on its own, at least not to a standard you would post to a general ledger without review. The best LLM line-item score in the benchmark set is 63 percent. On a 12-row invoice that means roughly four rows need a human. The failures also tend to be quiet ones: a plausible number in the wrong row, a quantity read as a unit price, a subtotal absorbed into the last line item. Those are worse than a blank field, because a blank field announces itself and a wrong number does not.
The standard mitigation is arithmetic, not a better prompt. Check that line items sum to the subtotal, that tax plus subtotal equals the total, and that quantity times unit price equals each line amount. Anything that fails goes to a human. This catches most of the quiet errors and costs you nothing per page, and once you are running real volume it pays to be monitoring the extracted dataset for anomalies rather than trusting that a pipeline which worked in March is still working in August. Vendor templates change without telling you.
Do I need to fine-tune an LLM for invoices?
Almost certainly not, and the attempt usually costs more than it returns. Fine-tuning needs a labeled corpus, a held-out evaluation set, and a plan for retraining as layouts drift. Nearly all of the accuracy gap in practice comes from three cheaper places: a schema that describes your fields precisely, one page per request rather than a whole PDF in a single call, and validation rules that catch arithmetic failures. Teams who do all three rarely find a reason to fine-tune, and teams who skip them rarely get fine-tuning to help.
Is a general LLM cheaper than a purpose-built invoice tool?
On inference alone, easily. On total cost, usually not, and the gap is not close. GPT-5 mini at 2,000 pages a month costs about $4 in tokens. What the $4 excludes is the entire product: a JSON schema you design and version, prompts per document family, retry handling for malformed output, the validation rules above, confidence scoring so reviewers know what to check, a review interface, storage, and an export into your accounting system. Six to ten developer weeks is a realistic estimate before that survives real vendor mail, and it does not stop needing attention afterward.
So the honest framing is build versus buy, not model A versus model B. If you have engineers and a reason to own the pipeline, token pricing is excellent value and the build is the point. If what you actually wanted was invoices in a spreadsheet, the model choice is a distraction. Our own invoice data extraction software handles field capture, line-item extraction, validation and export to Excel, CSV, JSON and QBO on a flat plan from $49 a month, which works out to roughly $19.60 per 1,000 pages with nothing left to build. There is also an invoice data extraction API if you want the endpoint without the per-token metering.
How to test this yourself in an afternoon
Public benchmarks tell you the shape of the answer. Your vendors decide the actual one, so run your own before committing.
- Pull 30 real invoices from your last month, weighted toward your highest-volume vendors and including your two ugliest scans.
- Key the correct answers by hand once. This is the boring step everyone skips and it is the only reason the rest of the exercise means anything.
- Run all 30 through two or three candidates: one cheap LLM tier, one mid LLM tier, and one purpose-built option such as Azure Document Intelligence or AWS Textract.
- Score header fields and line items separately. A single blended accuracy number hides the exact tradeoff that should drive your decision.
- Multiply the winner by your monthly page count, then add the engineering estimate. Compare that to a flat plan before you write any code.
Most teams who run this honestly discover their real requirement was line items all along, and that the cheapest model was never in the running. Better to find that out with 30 invoices than after two months of building.
Last updated August 2026. OpenAI token rates verified against the official OpenAI API pricing documentation on 10 August 2026. Accuracy figures attributed to Businessware Technologies, January and March 2025.