Skip to content
PDFBetter

Guide · AI

How to extract invoice data from PDFs to JSON or Excel

Reviewed

Hands turning the pages of a printed document at a desk with a tablet and coffee

Short answer

To extract invoice data from a PDF, use a field-based extractor: choose the fields you need (invoice number, invoice date, due date, supplier, total, tax, line items), run it on the PDF, check each value against the page and quote it came from, then export JSON, CSV or Excel. In PDFBetter, PDF to JSON does this for one invoice and the Extractions dashboard for a batch; it costs 1 AI credit per page read. If you only need a table copied as it looks, PDF to Excel is simpler and doesn't use AI.

On this page (6)

Extract one invoice

  1. 1

    Open PDF to JSON and upload the invoice

    Digital PDFs work directly. Run OCR first on scanned or photographed invoices.

  2. 2

    Start from the Invoice preset

    Keep the fields you need, delete the rest, and add your own — for example a purchase order number with the pattern PO-\d{6}.

  3. 3

    Extract

    Sign in with a free account. Each value comes back with a status, the page it was found on and the quote it was read from.

  4. 4

    Check what's flagged

    Values marked unverified, missing or invalid need a look. Everything else was matched to a quote on its page.

  5. 5

    Download

    Download JSON, or open the Extractions dashboard to export CSV or Excel.

  1. 1Your PDF

  2. 2Pick the fields

  3. 3Rows with page evidence

What PDF to JSON does, in three steps.

Extract a folder of invoices

In the Extractions dashboard, start a new batch: give the schema a name such as “Supplier invoices”, set its fields, then choose documents from your library or upload PDFs. A batch can hold up to 30 documents on Free and 100 on Pro. Documents run in the background, and one failure doesn't stop the others; retry failed documents from the batch page.

Review the results in one table. Click a cell to see its evidence, type a correction if needed, and approve or reject each document. Exports use your corrections and leave out rejected documents. Exports have one row per invoice; in Excel, line items go on a separate sheet.

Set up fields that extract well

Use the amount type for money so the currency code is captured separately, and the date type so every date comes out as YYYY-MM-DD. Add a short description with the label your suppliers actually use, such as “Amount payable” or “Toplam”. Mark fields you expect on every invoice as required, so a missing one stands out.

Invoices often show several similar numbers — subtotal, tax, total, amount already paid. Describe exactly which one you want; the quote next to each value shows which text the AI used.

Before you import the data

Extraction copies what is printed. It doesn't check whether the invoice adds up, whether a tax number is valid, or whether you've already paid it. Dates like 03/04/2026 are ambiguous; when the document doesn't show the order, the date is read day-first and marked unverified for you to confirm.

Document text is sent to OpenAI's API, whose API data-usage terms by default exclude API data from model training.

Tools used in this guide

Questions people ask

Can I extract data from scanned invoices?

Yes, after OCR adds a text layer. Run OCR PDF or AI OCR first, then extract from the recognized version. Handwriting and stamps aren't read.

Which is better for invoices, PDF to Excel or PDF to JSON?

PDF to Excel copies tables as they appear, which suits a single statement. PDF to JSON fills the same named fields for every invoice whatever the layout, which is what you need to import many suppliers' invoices into one sheet.

How much does it cost?

1 AI credit per page whose text is read. The Free plan includes 20 AI credits a month and Pro 500. Pages without a text layer aren't charged.

Can I run this automatically on new invoices?

Yes. Save a workflow with OCR, extract, review and export steps and point it at a folder; each invoice you move into the folder starts a run.

Does it read every page of a long invoice?

Up to 10 pages per document on Free and 50 on Pro. Pages beyond that are listed as not read.