Workflow template

Extract Data from Invoices with AI

Paste the text of any invoice and get a clean, structured data table -- vendor, date, line items, amounts, tax, and totals -- ready to copy into a spreadsheet or accounting system.

Copy-paste prompt

You are an accounts payable specialist. I will paste the text of one or more invoices. Extract all data into a structured table. For each invoice, output: | Field | Value | |---|---| | Invoice Number | | | Invoice Date | | | Due Date | | | Vendor Name | | | Vendor Address | | | Bill To (Company) | | | Line Item 1 -- Description | | | Line Item 1 -- Quantity | | | Line Item 1 -- Unit Price | | | Line Item 1 -- Amount | | [Repeat for each line item] | Subtotal | | | Tax Rate | | | Tax Amount | | | Discount | | | Total Due | | | Payment Terms | | | Notes / PO Number | | After the table, add: **Data Confidence:** List any fields where the value was missing or unclear in the original, and flag them with [MISSING] or [UNCLEAR]. Rules: - Extract exactly what appears in the invoice -- do not calculate or infer values unless clearly derivable from other stated values - If multiple invoices are pasted, produce a separate table for each, labeled Invoice 1, Invoice 2, etc. - At the end, produce a summary row: total number of invoices, total combined amount due --- INVOICE TEXT: [PASTE INVOICE TEXT HERE -- you can paste multiple invoices in sequence]

Every accounts payable team has a version of the same problem. Invoices arrive in different formats from different vendors, each with fields in different places, totals calculated differently, line items described inconsistently. Keying that data into a spreadsheet by hand is slow, error-prone, and the kind of work that makes good people consider different careers.

This workflow does the extraction for you. Paste the text of one invoice or twenty, and you get back a clean structured table for each: every field, every line item, the totals, and a confidence report flagging anything that was missing or ambiguous.

Getting the Input Ready

The prompt works with invoice text. How you get that text depends on the invoice format.

For a PDF invoice: if the PDF is digital (not a scan), open it, select all, and copy. The text will be messy but Claude handles that well. Paste it directly into the prompt after the “INVOICE TEXT:” line.

For a scanned PDF or an image of an invoice: you need a text conversion step first. Upload the image directly to Cowork and Claude will read it visually. For a batch of scanned invoices, Adobe Acrobat, Google Drive, and most free OCR tools online will convert them to selectable text. Run the OCR first, then paste the results.

For multiple invoices: paste them one after another in the same prompt, separated by a blank line or a simple label like “INVOICE 2:”. The prompt will produce a separate table for each and a summary row at the end with the combined total.

One thing worth checking before you paste: make sure the vendor name and invoice number are visible in the text. Those two fields anchor the whole table. If they are missing from the extracted text, the output will flag them as [MISSING], which is accurate but means you will need to fill them in manually.

The Prompt

With your invoice text ready to paste:

You are an accounts payable specialist. I will paste the text of one or more invoices. Extract all data into a structured table.

For each invoice, output:

| Field | Value |
|---|---|
| Invoice Number | |
| Invoice Date | |
| Due Date | |
| Vendor Name | |
| Vendor Address | |
| Bill To (Company) | |
| Line Item 1 -- Description | |
| Line Item 1 -- Quantity | |
| Line Item 1 -- Unit Price | |
| Line Item 1 -- Amount | |
[Repeat for each line item]
| Subtotal | |
| Tax Rate | |
| Tax Amount | |
| Discount | |
| Total Due | |
| Payment Terms | |
| Notes / PO Number | |

After the table, add:
**Data Confidence:** List any fields where the value was missing or unclear in the original, and flag them with [MISSING] or [UNCLEAR].

Rules:
- Extract exactly what appears in the invoice -- do not calculate or infer values unless clearly derivable from other stated values
- If multiple invoices are pasted, produce a separate table for each, labeled Invoice 1, Invoice 2, etc.
- At the end, produce a summary row: total number of invoices, total combined amount due

---
INVOICE TEXT:
[PASTE INVOICE TEXT HERE -- you can paste multiple invoices in sequence]

The “extract exactly what appears” rule is the important one. You do not want Claude rounding totals or inferring tax rates. You want the numbers that are on the invoice. If a total is wrong, that is information you need, not something to be quietly corrected.

What You Get Back

For each invoice, you get a two-column table: field name on the left, extracted value on the right. Line items repeat as many rows as the invoice has, numbered clearly. After the table, a Data Confidence section lists every field that was missing or unclear, with a [MISSING] or [UNCLEAR] flag so you know exactly where to follow up.

At the bottom, if you pasted multiple invoices, there is a summary row: count of invoices, combined amount due. Useful for batch reconciliation or quickly checking that the total matches what you were expecting before you start keying anything into your accounting system.

The table format is deliberately plain. Copy the output, paste it into Excel or Google Sheets, and the columns will populate correctly. If you need CSV format instead, add “Output as CSV” to the end of the prompt before your invoice text. The structure is identical; the delimiter changes.

What to Check Before Posting

Invoice data extraction is fast but not a replacement for review. Three things to verify before you accept the output:

The totals. Check that the extracted Total Due matches the invoice. This catches OCR errors if you ran a scan through a conversion tool before pasting.

The Data Confidence section. Every [MISSING] or [UNCLEAR] flag is a field that needs a human eye. Most will be fields the vendor simply left blank. Some will be fields where the extraction was ambiguous. Either way, do not post to your accounting system with unresolved flags.

Line item descriptions. These are often the messiest part of any invoice. Vendor line item text is inconsistent. The extraction will faithfully reproduce whatever the vendor wrote, including abbreviations, part numbers, and internal codes that may not match your chart of accounts. That mapping step is still on you.

For High-Volume Processing

This workflow is well-suited for batches of five to twenty-five invoices at a time. For a small team processing invoices weekly, it will handle the volume without any additional tooling.

If your team processes hundreds of invoices a month, dedicated accounts payable software with built-in OCR and ERP integration will eventually make more sense. That software costs money and takes time to set up. This prompt costs nothing and takes five minutes to learn. Start here, and upgrade when the volume actually warrants it.

Frequently asked questions

How do I get text from a PDF invoice to paste into this prompt?

If your PDF is text-based (not a scanned image), you can select all and copy-paste directly. For scanned invoices, use an OCR tool first -- Adobe Acrobat, Google Drive, or a free online OCR service will convert the image to selectable text. Claude can also read PDFs directly if you use the file upload feature.

Can AI extract invoice data from images or photos of receipts?

Claude can read images if you upload them directly. For a batch of receipt photos, upload each image and use the same extraction prompt. For high-volume invoice processing, dedicated accounts payable software with built-in OCR will be faster than manual uploads.

Is it safe to paste invoice data into an AI tool?

Invoices often contain vendor details, payment terms, and pricing that may be commercially sensitive. Check your organization's data handling policy before pasting invoice data into a consumer AI tool. Use an enterprise AI deployment for any invoices covered by confidentiality agreements.

Can I export this extracted data directly to a spreadsheet?

After Claude produces the table, copy and paste it into a spreadsheet -- most tools including Excel and Google Sheets will recognize the pipe-delimited format. For bulk processing, ask Claude to output the data as CSV instead by adding 'Output as CSV' to the end of the prompt.

More workflows