Pull Data Out of PDFs and Invoices with AI
- The flow is decide the fields → upload a few PDFs → ask for a table with one row per invoice or line → verify every number → paste into a sheet.
- Claude accepts PDFs (and CSV, XLSX and more) and Gemini accepts most file types. The ChatGPT pages we read describe attaching source files and images but give no upload limits (checked 2026-11-04).
- Per Anthropic, Claude reads text and visuals in PDFs of 100 pages or fewer, and text only for 101 to 1,000 pages. Gemini takes up to 10 files per prompt.
- A PDF often holds client names, bank details and prices. Check you may share it with the service, and mask what the table does not need.
- AI can misread or invent numbers. Recalculate the totals yourself before anything goes into your records. We did not run this exercise on real invoices, so the prompts and sample table are our own examples.
What you’ll be able to do
Section titled “What you’ll be able to do”- Turn a pile of PDF invoices or statements into one table with the fields you choose.
- Write an extraction prompt that returns the same columns every time and marks missing values instead of guessing.
- Decide which details to remove before you upload.
- Verify the result with a few simple checks, so a wrong digit does not reach your books.
For photos of paper receipts and household budgets, see Organize Household Budgets and Receipts with AI. This page focuses on PDFs, invoices and tables.
Concepts to know first
Section titled “Concepts to know first”| Term | Meaning |
|---|---|
| Extraction | Having AI read a document and copy chosen fields (invoice number, date, total) into a structured table. |
| Field | One piece of data you want, such as vendor name or due date. You decide the list. |
| Text PDF vs scanned PDF | A text PDF has real text you can select. A scanned PDF is a picture of a page, so the AI has to read the image, which is more error-prone. |
| Line items | The individual rows on an invoice (product, quantity, price), as opposed to the invoice total. |
| Reconciliation | Checking that the extracted numbers add up, for example that line items sum to the subtotal. |
What each service says it accepts (checked 2026-11-04)
Section titled “What each service says it accepts (checked 2026-11-04)”| Service | What the official help says | What we could not confirm |
|---|---|---|
| Claude | Documents: PDF, DOCX, CSV, TXT, HTML, ODT, RTF, EPUB, JSON, XLSX (XLSX needs code execution and file creation turned on). Chat uploads: up to 20 files per chat; PDFs limited to 1,000 pages. PDFs of 100 pages or fewer: text and visuals analyzed; 101 to 1,000 pages: text only. Non-PDF documents: text only, embedded images not read. Claude can create .xlsx files you download. | Which per-file size limit applies (500 MB vs 30 MB, see above); reading accuracy on scans. |
| Gemini | Up to 10 files per prompt (subject to availability); other file types up to 100 MB each; ZIP files up to 10 files and 100 MB. Rolling usage limits apply, with higher limits on Google AI plans. If analysis fails, re-upload. | Whether every PDF layout is read correctly. |
| ChatGPT | Web: attach source files, review the generated file in chat, download it, and name the page, sheet or table when asking for a revision. Images can be attached, pasted or dragged into the web composer. | File types and size limits for consumer accounts. |
Step-by-step guide
Section titled “Step-by-step guide”Practice first with two or three invoices you may share, or with made-up copies.
-
Decide your columns first
Write the fields you want, in order. For example: file name, vendor, invoice number, invoice date, due date, currency, subtotal, tax, total. Decide what to do when a value is missing. A fixed list is what keeps the table the same from one invoice to the next.
-
Prepare the files
- Prefer the original PDF from the sender over a photo or a scan of a printout.
- Split a long file if you only need some pages. Anthropic suggests dividing large documents into smaller sections.
- If it is a scan, expect more mistakes. Follow Anthropic’s image tip where relevant: images of 1000x1000 pixels or larger work better than small or low-resolution ones.
- Mask what you do not need, such as bank account numbers.
-
Upload a small batch
Use the + button in Claude, Add files in Gemini, or attach files in the ChatGPT web composer. Start with two or three files, not the whole folder, so you can check the result.
-
Ask for a table with rules
Copy and paste this promptRead each attached PDF invoice. Return one table with one row per invoice and these columns in this order: file name, vendor, invoice number, invoice date (YYYY-MM-DD), due date (YYYY-MM-DD), currency, subtotal, tax, total. Rules: copy values exactly as printed. If a value is missing or unreadable, write NOT FOUND instead of guessing. Do not calculate or fix anything. After the table, list any invoice where the subtotal plus tax does not equal the total.
-
Extract line items when you need them
Copy and paste this promptFor the attached invoice, return one row per line item with these columns: line number, description, quantity, unit price, line amount. Copy the values exactly as printed. Add a final row labeled CHECK that shows the sum of the line amounts so I can compare it with the printed subtotal. Mark anything unclear as NOT FOUND.
-
Verify before you trust it
Open the PDF next to the table and compare. At minimum:
- Check every total and date against the document, not only a sample, when the numbers matter.
- Add up the line items yourself, or with a spreadsheet
SUM, and compare with the printed subtotal. - Check that the row count matches the number of invoices you uploaded.
- Look for invoices the AI skipped or merged.
If a value is wrong, tell the AI which row and which field, and ask it to re-read that page.
-
Move the table into a sheet
Copy the table into Google Sheets or Excel, or ask Claude for an .xlsx file. Anthropic says Claude can create Excel files you can download or save to Google Drive, with code execution and file creation turned on. Then set the number columns to a number format and add your own
SUMto compare with the AI’s totals. For adding AI to the sheet itself, see Adding AI to Excel and Google Sheets: Copilot, Gemini, and Claude. -
Keep a record and delete what you no longer need
Keep the original PDFs as your source of truth. Review the privacy settings and chat history of the service you used. See Turn Off AI Training on Your Chats: Privacy Settings in Claude, ChatGPT and Gemini.
Quick reference
Section titled “Quick reference”Prompt rules that reduce errors
Section titled “Prompt rules that reduce errors”| Rule | Why |
|---|---|
| Give the exact column list | Same structure every run |
| “Copy exactly as printed” | Stops silent rounding or reformatting |
| “Write NOT FOUND instead of guessing” | Makes gaps visible |
| “Do not calculate or fix anything” | Keeps extraction separate from your checking |
| Ask for a CHECK row or a mismatch list | Surfaces sums that do not add up |
| Start with two or three files | Catches layout problems early |
Checks to run on every batch
Section titled “Checks to run on every batch”| Check | How |
|---|---|
| Row count | Same as the number of files |
| Totals | Subtotal plus tax equals total; line items sum to subtotal |
| Dates | Match the PDF, in one date format |
| Currency | Same on each row, or noted |
| Duplicates | The same invoice number should not appear twice by mistake |
Common sticking points
Section titled “Common sticking points”The table has the wrong number in one cell
Section titled “The table has the wrong number in one cell”- Cause: The AI misread a digit, especially in a scan, or picked a different number on the page.
- Fix: Compare to the PDF, name the row and field, and ask it to re-read that page. Fix it by hand if needed.
Rows are missing or merged
Section titled “Rows are missing or merged”- Cause: Too many files at once, or an invoice that spans several pages.
- Fix: Run smaller batches and check the row count. Gemini’s help lists up to 10 files per prompt, and Claude’s up to 20 files per chat.
The upload fails or the answer misses details
Section titled “The upload fails or the answer misses details”- Cause: The file is too large or too long. Anthropic says PDFs over 1,000 pages cannot be uploaded, and Gemini’s help says very large uploads can give answers that miss details.
- Fix: Split the file into sections and process them separately.
The AI explains instead of giving a table
Section titled “The AI explains instead of giving a table”- Cause: The prompt did not say what to return.
- Fix: State the columns and say “return only the table”.
Practical tips
Section titled “Practical tips”- Numbers are yours to check. Do not post, pay or file anything from an unverified table. See Can You Trust AI Answers? How to Fact-Check.
- Share the minimum. Remove columns of data you do not need, and mask account numbers before upload.
- Keep a log. Note the date, the files, the prompt and who checked the totals.
- Mind company and client rules. Documents from clients may be covered by agreements. When in doubt, ask first.
- This is not accounting or tax advice. For tax or legal questions, ask a qualified professional. See Can You Use AI Output? Copyright and Ethics Basics for related cautions.
- Reuse your best prompt. Once a prompt works, save it. A repeated job can become a template; see Build Reusable Document Templates with AI.
What to read next
Section titled “What to read next”- Organize Household Budgets and Receipts with AI — receipt photos and personal budgets
- Adding AI to Excel and Google Sheets: Copilot, Gemini, and Claude — work on the table inside a spreadsheet
- Create and edit files with Claude (Excel, Word, slides, PDF) — get Excel, Word and PDF files from Claude
- Using AI While Protecting Personal and Company Information — what not to upload
Sources
Last verified: Nov 16, 2026
- Upload files to Claude (Claude Help Center) support.claude.com
- Create and edit files with Claude (Claude Help Center) support.claude.com
- Upload & analyze files in Gemini Apps (Gemini Apps Help) support.google.com
- Work with files (ChatGPT docs) learn.chatgpt.com
- Image inputs (ChatGPT docs) learn.chatgpt.com
Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.
Finished this tutorial?
Progress is saved only in this browser and never sent anywhere.