Extract data from PDFs and invoices with AI. Which route for which document, and what to check before the data reaches your ERP.
Any assistant can read a PDF today. The risk lies in the wrong total that slips into your accounting software without anyone noticing. Here is the route for each document and the checking sheet in Excel.
To extract data from a PDF with AI, you give the document to a model that reads text and images, ask for a fixed list of fields and check the values before you use them. For a few pages ChatGPT or Claude will do; for hundreds a month you need an automated flow and a confidence threshold.
Italian e-invoices should not be extracted from the PDF. The Italian Revenue Agency states that an e-invoice is an XML file sent through the Exchange System (SdI): the fields already have names, and the PDF is only a copy for reading.
A JSON schema guarantees the shape, not the values. OpenAI says so in its documentation: the rules the schema cannot express, such as net amount plus VAT equalling the total, still have to be checked.
The field list and the checking sheet are free to download below, in Excel, with no email required.
Written by: Mattia Esposito, AI and marketing consultant, founder of Itria AI. From Puglia, based in Turin since 2023, he works remotely in Italy and abroad. LinkedIn profile.
The field list and the checking sheet, to download
One Excel file with four sheets: the fields of an invoice with the names they carry in the XML, a checking sheet that works out by itself what goes straight in and what goes to a person, the route for each type of document, and a worked example. The PDF shows the example, to print or to show the person who runs your accounts.

| File | Contents | Link |
|---|---|---|
| Excelto fill in, in Italian | The field list, the checking sheet with the checks already written in, the routes by document, the example. | |
| PDFto read, in Italian | The field list and the checking sheet filled in for a made-up company. |
| Check in the sheet | What it looks at | If it fails |
|---|---|---|
| Totals | Net amount plus VAT equals the total, to within one cent. | To a person |
| VAT number | Eleven digits for an Italian supplier. | To a person |
| Date | Not in the future and not older than the limit you set. | To a person |
| Confidence | The tool's score, if it gives one, above the threshold you set. | To a person |
| Unreadable document | Marked as such, with the fields left empty. | To a person |
On 4 September 2026 I tested the part of Itria that reads documents on a batch of 30 files: orders, delivery notes and invoices. The batch also held an unreadable PDF, put there on purpose, with no text layer inside.
The document type was recognised in 30 cases out of 30 and 234 of the 237 fields extracted were correct, 98.7%. The unreadable PDF was classed as “other” and set aside, without a single invented field. It was a test run on a test system, not at a client, and it can be run again in front of anyone who asks.
Of the two figures, the second matters more to a business. A checking rule catches a wrong field. A total invented with confidence from a page nobody could read ends up in the accounting software, and from there in a payment. In the glossary entry on AI hallucinations that test sits next to the measurements published by OpenAI and by Stanford.
How to extract data from a PDF: first, work out what kind of document you have
The route depends on where the data lives: in an XML file, in the text of the PDF, or only in the image of the page. With XML you need no artificial intelligence at all; with text you need a model that can tell which number is the total; with an image you first need OCR, which turns the page into text.
The difference between a native PDF and a scanned one, with the test of selecting a single word, is in the glossary entry on OCR. Here the next step matters: a program that copies the text of a PDF gives you the words, but cannot tell which figure is the net amount and which the quantity. Putting a name to every value is extraction, and a language model does it.
| Document | Where the data lives | The route |
|---|---|---|
| E-invoice from an Italian supplier | In the XML file sent through the Exchange System. | Download the XML and read it as it is. |
| Invoice from a foreign supplier | Usually in a PDF: in Italy, e-invoicing is optional for transactions with foreign parties. | Extraction against a schema of fields. |
| Scan or photo | Only in the image of the page. | OCR, then extraction. |
| Delivery notes and customer orders | In the PDF or in the email attachment. | Extraction against your own list of fields. |
| One or two documents, once | Wherever it happens to be. | ChatGPT or Claude, by hand. |
| Hundreds a month | Wherever it happens to be. | An automated flow with checks and a threshold. |
Reading Italian e-invoices: the data is already in the XML
Since 1 January 2019, invoices between parties resident or established in Italy have been electronic, and an Italian e-invoice is an XML file sent through the Exchange System, the SdI. In its December 2025 guide the Italian Revenue Agency says that an invoice issued in any other form, outside the SdI, counts as not issued. The PDF that often comes with it is a copy for reading.
The volume is huge: in 2025 around 2.4 billion invoice files went through the Exchange System, issued by 5.5 million parties. Every one of those files carries its fields under their own names, set by the FatturaPA format, which the official site describes as the only format the Exchange System accepts. Extracting that data from a PDF with AI means rebuilding, with a margin of error, information that already exists in exact form.
The XML of invoices issued and received can be downloaded from the Revenue Agency's reserved area, “Fatture e Corrispettivi”, or from your intermediary's software. The Agency itself points out the benefit of taking it directly: lower processing costs and fewer of the errors that manual data capture can introduce. The downloadable field list shows, next to each field, the name it has in the file, so the same list works for the XML and for PDFs.
| Field | Name in the XML file (FatturaPA) | Check |
|---|---|---|
| Supplier VAT number | IdFiscaleIVA, with IdPaese and IdCodice | Matches your supplier records |
| Number and date | Numero, Data | No duplicates |
| Rows | Descrizione, Quantita, PrezzoUnitario, AliquotaIVA | Quantity times price |
| VAT summary | ImponibileImporto, Imposta | Net amount times rate |
| Total | ImportoTotaleDocumento | Net amount plus VAT |
| Payment | DataScadenzaPagamento, IBAN | IBAN matches your supplier records |
That leaves invoices from foreign suppliers, for which e-invoicing is optional and the document usually arrives as a PDF, plus delivery notes, orders, quotes, receipts and the paper archive. If you export, the same logic applied to packing lists and export invoices is in the guide to shipping documents.
Extracting data from a PDF with ChatGPT or Claude
ChatGPT and Claude read a PDF as text plus an image of every page, so they also see tables, stamps and scans. OpenAI's documentation says so for models with vision, from gpt-4o onwards: the API extracts “both text and page images” and sends both to the model. Anthropic describes the same mechanism for Claude: each page becomes an image, with its text alongside.
For one or two documents you work in the chat: upload the file and ask for a table with the fields from the list, in the same order. ChatGPT accepts documents of up to 512 MB, but on the Free plan the limit is 3 files a day. Claude, through the API, reads up to 600 pages per request, or 100 when the model's context is below one million tokens, and each page costs between 1,500 and 3,000 tokens of text plus the image.
For a repeated flow you use the API with output constrained to a JSON schema: the model always returns the same fields, with the right types, ready for a spreadsheet or for the ERP. OpenAI and Anthropic both offer this, and both describe it as a guarantee of shape. OpenAI adds that you still have to “validate any business rules that the schema does not express”.
Before you upload documents containing client, supplier or employee data, the plan matters. OpenAI says content sent to its business offerings, the API and Enterprise, is not used to train its models; where that data then sits and who can demand it is the subject of the guide on ChatGPT, GDPR and the Cloud Act. For documents in a foreign language, the companion guide on translating documents with AI covers the translation side.
AI document extraction tools for volume: Azure AI Document Intelligence and Google Cloud Document AI
For hundreds of documents a month there are services with models already trained on invoices, which return the fields in JSON together with a confidence score. The invoice model in Azure AI Document Intelligence, documented by Microsoft on 15 August 2026, reads photos, scans and PDFs, extracts the key fields and the line items, and handles invoices in 27 languages, Italian included.
The confidence score is what makes a flow with a person in it possible: each field comes with how sure the tool is that it read it right, plus its position on the page, and below a threshold the document stops. The Invoice Parser in Google Cloud Document AI extracts header and line-item fields: invoice number, supplier, amount, tax, date, due date. Google lets you choose the “eu” region for processing.
| Option | What it returns | When it makes sense |
|---|---|---|
| XML of the Italian e-invoice | The exact fields, under their own names. | Always, for Italian suppliers |
| ChatGPT or Claude in the chat | A table to copy, with no checks. | One or two documents |
| OpenAI or Anthropic API with a JSON schema | Always the same fields, in the agreed shape, for delivery notes and orders too. | Mixed documents, your own fields |
| Azure AI Document Intelligence, invoice model | Fields and line items in JSON, with confidence and position for each field. | Many foreign or scanned invoices |
| Google Cloud Document AI, Invoice Parser | Header and line items of the invoice. | Many invoices, processing in the EU |
The tool then connects to everything else: the folder or mailbox where documents arrive on one side, the ERP on the other. How to choose the platform that holds the steps together is the subject of the companion guide on n8n vs Make vs Zapier.
How many errors manual entry makes, and how many AI makes
Manual data entry gets around 1% of values wrong, and checking by eye does not reduce errors measurably. The study by Kimberly Barchard and Larry Pace, published in 2011, had 195 university students each enter 30 data sheets using three different methods. Barchard's lab sums it up: “single entry leads to error rates of around 1%”.
In the same study, visual checking produced 2,958% more errors than double entry, and was not significantly better than single entry. Most errors fall within the plausible range of the value, so they cannot be seen. These are research data typed in by students, not invoices keyed in by office staff: the figure is useful for the shape of the error, small and invisible.
For AI there is no official figure. None of the OpenAI, Anthropic and Microsoft pages read for this guide publishes an error rate on invoices, and the near-100% accuracy claims you read online often come from the people selling the tool. The only figure that counts for a business comes from a batch of its own real documents, counting the correct fields one by one, and the checking sheet is built for that.
What to check before the data reaches your ERP
Every extracted field goes through checks written down before you start, and anything that fails goes to a person. The checks that matter are few: the totals add up, the VAT number has the right format, the date is plausible, the number is not already recorded, the confidence is above the threshold.
An IBAN that differs from the one in your supplier records is not corrected in the sheet: you confirm it with the supplier, on the phone number you already have.
The most important case is the document nobody can read. A well-built system sets it aside and flags it; a badly built one fills in the fields anyway, and you get a hallucination dressed up as data. Before you choose a tool, give it an unreadable scan and see what comes back. The person who approves, the human in the loop, belongs where a mistake is costly: amounts, IBANs, new suppliers.
The last check is on the list of fields itself. Extracting everything on the document produces columns to clean, and the cleaning is the same manual work you wanted to remove. The field list is there to decide in advance, field by field, what you really need and what name your ERP expects for it.
The batch. 30 documents across orders, delivery notes and invoices, with 237 fields to extract, on an Itria test system.
The result. Document type recognised in 30 cases out of 30; 234 of 237 fields correct, 98.7%; 6.264 seconds per document.
The unreadable document. A PDF with no text, put there on purpose: classed as “other”, no field invented.
What it is not. A measurement at a client. It can be run again in front of anyone who asks, and the component is described on the page about automatic document entry.
Where to start in a company
Reading documents is the most common use of artificial intelligence among the Italian companies that use it. According to Istat, in 2025 16.4% of companies with at least 10 employees used at least one AI technology, and 70.8% of those used it to extract information from text documents.
Start with the document that eats the most hours, usually customer orders or foreign invoices, and with ten fields at most. Try the tool on a month of real documents with the checking sheet, look at how many end up with a person, and only then connect it to the ERP.
To see where else time goes missing between one program and the next, there is the process map; the other guides on automation, marketing and AI at work are gathered on the guides page.
Questions and answers
Is there a free AI that reads PDFs?
ChatGPT accepts PDFs on the Free plan too, with tighter limits: according to the OpenAI Help Center, updated on 12 November 2026, the free plan allows 3 files a day. You upload the document and ask for the fields in a table.
One or two documents are fine this way. For a workflow you need something else: such a low file limit, and no check on the totals, make it a trial run and not a system.
Can I use ChatGPT to read invoices?
Yes, for PDF invoices from foreign suppliers or for scanned documents: ChatGPT reads the text, the tables and the images of the pages. For e-invoices from Italian suppliers you do not need it, because the data already sits in the XML file sent through the Exchange System.
Before you upload documents with client or supplier data, check your plan: OpenAI says content sent to its business offerings, the API and Enterprise, is not used to train its models.
How do I turn the data in a PDF into an Excel file with AI?
Decide the list of fields first, then ask the model to return them in a table or in a fixed format, a JSON schema, which opens in Excel. OpenAI and Anthropic both offer output constrained to a schema.
The schema guarantees the columns and the formats, not the values: before you use the file, check at least that the net amount plus VAT gives the total.
How reliable is AI at extracting data from documents?
None of the official OpenAI, Anthropic and Microsoft pages read for this guide publishes an error rate on invoices. Reliability is measured on the company's own documents, counting the correct fields one by one.
In a test on 4 September 2026 with 30 documents, Itria's system extracted 234 of 237 fields correctly. For comparison, manual data entry gets around 1% of values wrong according to the authors of a 2011 study.
How can I convert a PDF into an AI file?
An .ai file is the Adobe Illustrator format, the design program: to open a PDF there you use Illustrator itself. If the question is how to get an artificial intelligence to read a PDF, there is no need to convert it: ChatGPT and Claude accept the PDF as it is, and read its text and an image of every page.
Notes on sources
- Italian Revenue Agency, La fattura elettronica e i servizi gratuiti dell’Agenzia delle Entrate, guide of December 2025: obligation since 1 January 2019, XML format and SdI, invoice counted as not issued, transactions with foreign parties, the Fatture e Corrispettivi area and the benefit of acquiring the XML. Read on 13 November 2026.
- Italian Revenue Agency, Cos’è la FatturaPA and Formato FatturaPA: the field names are those of the official XSD schema, checked on 13 November 2026.
- Italian Revenue Agency, Risultati 2025: 2.4 billion invoice files handled by the SdI and 5.5 million issuing parties in 2025.
- OpenAI, File inputs and Structured Outputs, source of the two quoted phrases; Help Center, Uploading files and audio to ChatGPT, updated on 12 November 2026. Read on 13 November 2026.
- Anthropic, PDF support and Structured outputs. Read on 13 November 2026.
- Microsoft Learn, Document Intelligence invoice model, 15 August 2026, and supported languages; Google Cloud, Document AI processor list and regions. Read on 13 November 2026.
- Barchard and Pace, Preventing human error, Computers in Human Behavior, 2011 (abstract read); Barchard's lab, University of Nevada Las Vegas, Data Checking, June 2017, source of the quoted phrase on the 1%.
- Istat, Imprese e ICT, anno 2025: companies with at least 10 employees.
- The test of 4 September 2026 was run on an Itria test system, with 30 documents and 237 fields: it is not a measurement at a client.
Extracting the fields is the easy part. The work lies in the checks, and in a person's yes where it matters. The system first, then the growth.
Mattia Esposito, who wrote this guide, builds tailored AI systems for small businesses with Itria: automations connected to the software the business already uses, and a Dashboard showing what has happened and what is waiting for a decision. Nothing goes to a customer without a person’s yes. On a test bench on 4 September 2026, with 30 documents including orders, delivery notes and invoices, the system extracted 234 fields out of 237 correctly, and the unreadable document deliberately placed in the batch was set aside without a single invented field.