How to extract data from a PDF with AI
Updated
Contents
To extract data from a PDF with AI, open AI Data Extraction, add your PDF, list the values you want under Fields to extract, or switch to Prompt and describe them, and press Extract data. An AI model reads the document's text and returns the values as JSON, and you download a ZIP with the JSON and a readable table.
Use the values as a first draft, not as a record. The model is told to answer null rather than guess. It is also told to use only the document's text, yet nothing checks a value against the pages afterwards, so check any figure you plan to act on against the original.
AI Data Extraction is one of the AI tools, so the work does not happen in your browser. Your PDF uploads over an encrypted connection to our secure server, which extracts the selectable text and sends that text, with your field list or instruction, to a third-party AI provider; the PDF file itself is never sent to the provider. Your PDF is deleted when the job ends, and our server's link to the ZIP stops working after 60 minutes. No account is needed.
Step by step
- 1Open the AI Data Extraction tool. Extract data works once the status badge reads Secure server.
- 2Drop one PDF on the box that says “Add your PDF, or browse”, or click it to choose the file. It needs selectable text; for a scan, run OCR PDF first.
- 3Under Fields to extract, type a field name of up to 80 characters, such as invoice_number, and choose its type: string, number, boolean, date, or array. Add field adds a row, up to 50.
- 4Or press Prompt and describe what you want in the What to extract box, up to 2,000 characters.
- 5Press Extract data. Your PDF uploads over an encrypted connection to our secure server, and the button follows the job while the model reads.
- 6Press Download invoice-extraction.zip, the button named after your file: invoice.pdf comes back as invoice-extraction.zip. Save it to your device before you close the tab.
Field schema or prompt
Field schema is selected when the page opens. The model is told to use each field name, unchanged, as a key in its answer, so a schema such as invoice_number, invoice_date, vendor and total asks every invoice for the same four keys, and a script can read the results side by side. Give a field the array type to collect a list, such as every product code. Two fields cannot share a name, even if only their capital letters differ; the page flags the repeat and keeps Extract data inactive until you rename it.
Prompt suits a one-off question in your own words, such as the parties, the start date and the notice period in a contract. The model is then asked for a flat JSON object and chooses descriptive key names itself, so the keys can differ from one document to the next.
What you download
In the ZIP, model-output.json is the model's reply as it was returned. extraction.json holds the same data; with a field schema it lists every field you asked for, in your order and under your names, and a key the model respelled is mapped back to your name. A requested field the model did not return at all is null in extraction.json too, and manifest.json lists it under extraction.missingKeys.
extraction.md lays the data out as a Field and Value table, or as a numbered list when the reply is a list. In extraction.md a null reads "not found, or several different values". manifest.json records the provider and model, your fields or prompt, and how much of the document was read, and README.txt describes the package. There is no CSV or spreadsheet; for data in rows and columns, Extract Tables writes a CSV per table and an Excel workbook.
Nulls, wrong values and long documents
A null means the model gave no single value: it may not have found one, or the text may hold several different values for the field. A value that is not null may still be one of several different values, so to get every value, ask for a list: the array type in a field schema, or a list in your prompt. A wrong value comes from the model's reading or from the text it was given: a misread OCR layer, or side-by-side columns read across as one line, can mislead it. When a page holds several similar figures, name the exact one you want.
The model reads a bounded amount of the document's text, and the exact figure is stated on the AI Data Extraction page itself. Past that point the text is dropped, and the result says how far the reading got. A null was judged only on the text that was read, so the value may still appear later in the document. Files themselves are capped at 100 MB.
The free allowance and where your text goes
Extractions are free, within a daily allowance. 30,774 free characters of AI text a day for your connection. One run never counts more than 10,258 of them, however long the document is, and the allowance resets daily. However long the document, at least 3 extractions fit in a day if nothing else draws on it. The other AI tools draw on the same allowance. The charge is taken when the job is submitted, so a job our server refuses or that fails still uses it.
Our server sends the PDF's extracted text, with your field names or instruction, to a third-party AI provider; the PDF file itself is never sent to the provider. The settings in our provider account that would let it use this text to improve its models are switched off, though the provider may keep what it receives for a limited time to watch for abuse. Section 3 of our privacy policy covers the provider's side.
Scanned PDFs need OCR first
The tool reads only text stored in the PDF as text. Your browser checks the file for text before anything is sent, and a scan with none is stopped there with a message pointing you to OCR PDF; that refusal takes nothing from the allowance.
Run the scan through OCR PDF with the document's language selected, then extract from the searchable copy, and check the figures, since recognition can misread them.
Common questions
Is the extracted data accurate?
Treat it as a first draft. The model is told to answer null rather than guess. But nothing checks a value against the pages, so a figure can still be wrong. Check anything you plan to rely on against the original.
How many extractions can I run for free?
30,774 free characters of AI text a day for your connection. One run never counts more than 10,258 of them, however long the document is, and the allowance resets daily. However long the document, at least 3 extractions fit in a day if nothing else draws on it. The other AI tools draw on the same allowance.
Who sees the text of my PDF?
A third-party AI provider receives the extracted text and your field names or instruction; the PDF file never reaches it. Our server deletes your PDF when the job ends, and the link to the ZIP stops working after 60 minutes.
Can I get the data as CSV or Excel?
Not from this tool: it writes JSON and a Markdown table. For tables, Extract Tables returns a CSV per table and an Excel workbook, without AI, on our secure server.
Can it extract data from a scanned PDF?
Not directly. Run it through OCR PDF first to add a text layer, then extract from the result. A PDF with no text is refused before it is sent, so it costs nothing from the allowance.