15 best AI data extraction prompts: Extract data from invoices, receipts, and forms

Use 15 AI data extraction prompts to pull invoice, receipt, and form details into structured tables.

AI data extraction prompts work best when they name the document type, required fields, output format, validation rules, how to handle missing or unclear text, and how the model should verify extracted values. For accountants, bookkeepers, accounts payable teams, operations coordinators, and anyone reviewing invoices, receipts, or forms at scale, that structure makes automated extraction more accurate, easier to review, and less prone to costly errors.

The 15 copy-ready prompts below show best practices for extracting data from invoices, receipts, and forms, with templates for verification and exception handling and guidance on using pdfFiller’s AI Assistant to apply them in real workflows. Use them to reduce manual entry, catch inconsistencies before approval, and keep document-heavy finance, legal, healthcare, and compliance processes moving.

Key takeaways

  • Ask for specific fields instead of telling AI to “extract the data.”
  • Define the output format, such as a table, CSV-ready rows, or JSON.
  • Tell AI to mark missing and uncertain information instead of guessing.
  • Preserve source values before standardizing dates, currencies, or categories.
  • Compare names, IDs, dates, totals, and line items with the source document.
Sign up for a free trial to see pdfFiller in action

Start Free Trial

How does prompt engineering with AI data extraction prompts improve document data extraction?

Effective AI data extraction prompts use large language models and prompt engineering as methods for information extraction from documents, giving the model a clear extraction schema and rules for handling ambiguity. This makes the output easier to review and reuse. Effective prompt engineering can improve extraction accuracy by about 8% F1 in some evaluations.

Include five elements in each prompt:

Prompt element What to specify
Document type Invoice, receipt, application form, or another document
Required fields The exact names, dates, amounts, selections, or line items you need
Output structure Table, JSON, CSV-ready rows, checklist, or summary
Missing-data rule Use “Not found” or null instead of estimating
Verification rule Include page references, preserve source text, and flag uncertainty

 

Use the source document as the only evidence unless your task specifically requires external information. Before sharing a document with any AI system, follow your organization’s privacy rules and remove information the task doesn’t require. Data scarcity can be a challenge because it leaves traditional deep learning approaches limited, while LLM-based extraction in natural language processing often maintains strong performance with less task-specific training data, which underscores the importance of careful prompt design.

Which AI prompts for data extraction work best for invoices?

The best invoice data extraction prompts separate header information, line items, payment details, and review checks. pdfFiller documents AI-assisted extraction of invoice dates, amounts, vendor details, and line items on its invoice data extraction page.

Basic invoice extraction

Prompt 1: Extract essential invoice details

 

Read the attached invoice as the input for this information extraction task and extract only the information shown in the document.

For the expected output format and desired output, return a table with these rows:

  • Vendor name
  • Vendor address
  • Customer name
  • Customer address
  • Invoice number
  • Purchase order number
  • Invoice date
  • Due date
  • Currency
  • Subtotal
  • Tax
  • Discounts
  • Fees
  • Total amount
  • Amount due

Use the columns “Field,” “Extracted value,” “Source page or section,” and “Status.” Write “Not found” when a field is absent. Preserve names, numbers, dates, and currency symbols exactly as written. Do not infer missing values.

Including relevant examples of raw input and desired output can reduce formatting errors when adapting this template.

Use this when: You need a quick, reviewable overview of an invoice.

Human review: Compare every date and monetary value with the invoice before recording, approving, or paying it.

➡️ Try this prompt in pdfFiller

Structured invoice data

Prompt 2: Extract invoice line items

 

Extract every line item from this invoice, including items continued on later pages.

Return one Markdown table with these columns:

  • Line number
  • Item or service description
  • SKU or product code
  • Quantity
  • Unit
  • Unit price
  • Discount
  • Tax rate
  • Tax amount
  • Line total
  • Source page

Keep each item on a separate row. Preserve the document’s wording and number formatting. If a value is unreadable, write “Unclear” and identify its page. Do not merge similar items or calculate missing values. For complex line-item layouts, few-shot prompting with one or two examples that include relevant data can improve model understanding and support harder extraction techniques.

Use this when: You need to extract line items from an invoice for review or spreadsheet entry.

Human review: Confirm that no rows were skipped, duplicated, or assigned to the wrong column.

➡️ Try this prompt in pdfFiller

Prompt 3: Find payment terms and missing invoice fields

 

Review this invoice for payment information and incomplete fields.

Extract:

  • Payment terms
  • Payment deadline
  • Payment method
  • Bank or remittance details
  • Late-payment terms
  • Early-payment discount
  • Billing contact
  • Purchase order reference
  • Tax identification number

Then create a second table listing fields that are blank, missing, unreadable, or internally inconsistent. Quote the relevant source text and include its page number. Do not decide whether the invoice should be paid. Negative prompting is crucial to keep the output focused and reduce the extraction of irrelevant information beyond the relevant information.

pdfFiller AI Assistant reviewing an invoice to extract payment information and identify incomplete fields.

pdfFiller’s AI Assistant analyzes an invoice for payment terms, deadlines, payment methods, billing details, and missing information.

Use this when: You need to prepare an invoice for accounts-payable review.

Human review: Verify payment instructions through an approved channel, especially when bank details are new or changed.

➡️ Try this prompt in pdfFiller

Prompt 4: Convert invoice details into accounting-ready JSON

 

Extract the attached invoice into a valid JSON format using this structure:

{

“vendor”: {

“name”: null,

“address”: null,

“tax_id”: null

},

“customer”: {

“name”: null,

“address”: null

},

“invoice”: {

“number”: null,

“purchase_order_number”: null,

“invoice_date”: null,

“due_date”: null,

“currency”: null

},

“amounts”: {

“subtotal”: null,

“tax”: null,

“discount”: null,

“fees”: null,

“total”: null,

“amount_due”: null

},

“line_items”: [],

“payment_terms”: null,

“uncertain_fields”: []

}

Return JSON only, with the extracted information presented exactly in the schema shown. Keep source values as strings so leading zeros and original date formats are not lost. Use null for missing values. Add unclear values to “uncertain_fields” with the field name, source text, and page number.

Use this when: You need structured data for a reviewed import or another accounting workflow.

Human review: Validate the schema and all financial values before importing the data into another system.

➡️ Try this prompt in pdfFiller

Invoice summaries

Prompt 5: Summarize an invoice without losing key figures

 

Summarize this invoice in no more than eight bullet points.

Include:

  • Who issued the invoice
  • Who is being billed
  • Invoice number and date
  • Main goods or services
  • Billing period, if stated
  • Amount due and currency
  • Due date and payment terms
  • Any missing, unusual, or unclear information

After the summary, add a “Values to verify” list. Preserve all figures exactly as shown and do not describe the invoice as approved, valid, or accurate.

pdfFiller AI Assistant summarizing an invoice and identifying missing issuer, recipient, payment, and billing details.

pdfFiller’s AI Assistant reviews an invoice and summarizes key information, including parties, invoice details, goods or services, payment terms, and missing fields.

Use this when: A manager or reviewer needs a concise invoice overview.

Human review: Use the summary for orientation, not as authorization to record or pay the invoice.

➡️ Try this prompt in pdfFiller

Hypothetical example: A bookkeeper receives a three-page equipment invoice. Prompt 2 produces a line-item table, which helps achieve a concise summary plus follow-up checks without losing key figures, while Prompt 3 flags that the purchase order number is missing and one payment instruction appears only in the footer.

Which prompts can extract data from receipts?

Receipt data extraction prompts should preserve transaction evidence while separating extracted facts from suggested expense categories. Categories can support review, but they don’t determine tax treatment or reimbursement eligibility.

Receipt details and expense records

Prompt 6: Extract information from one receipt

 

Extract the following information from this receipt:

  • Merchant name
  • Merchant address
  • Transaction date
  • Transaction time
  • Receipt or transaction number
  • Purchased items
  • Quantity and price for each item
  • Subtotal
  • Discounts
  • Tax
  • Tip
  • Total
  • Currency
  • Payment method
  • Last four payment-card digits, if visible

Use “Not found” for absent fields and “Unclear” for unreadable text. Do not reconstruct cropped or faded values. This keeps the extraction focused on only the relevant data visible in the receipt. Treat item names, dates, totals, and payment details as separate type information.

pdfFiller AI Assistant extracting transaction, payment, and purchase details from a receipt according to AI data extracting prompt.

pdfFiller’s AI Assistant analyzes a receipt to extract structured data such as transaction dates, purchased items, totals, currency, and payment method.

Use this when: You need a structured record of a single purchase.

Human review: Match the total, tax, tip, and payment method to the original receipt and related account record.

➡️ Try this prompt in pdfFiller

Prompt 7: Suggest expense categories

 

Extract the merchant, transaction date, purchased items, tax, tip, total, currency, and payment method from this receipt.

For each item, suggest one plain-language expense category from this list:

[INSERT APPROVED EXPENSE CATEGORIES]

Return a response with:

  • Item
  • Extracted amount
  • Suggested category
  • Reason for suggestion
  • Review status

Base each suggestion only on the receipt description. Write “Needs review” when the description is too vague. The idea is to extract the receipt facts first and only then suggest categories based on the item details of interest. Do not determine tax deductibility, reimbursement eligibility, or accounting treatment.

Use this when: You want to prepare receipt information for an expense review.

Human review: Have an authorized reviewer apply the company policy and accounting or tax rules.

➡️ Try this prompt in pdfFiller

Prompt 8: Build a multi-receipt expense log

 

Treat each receipt in this document as a separate transaction.

Create one table with these columns:

  • Receipt number
  • Merchant
  • Transaction date
  • Short purchase description
  • Subtotal
  • Tax
  • Tip
  • Total
  • Currency
  • Payment method
  • Source page
  • Review note

Do not combine transactions. Flag possible duplicate receipts based on matching merchant, date, and total, but do not delete them. After the table, report totals separately for each currency. Do not convert currencies or supply missing exchange rates. Test this prompt across different merchants, currencies, and multi-page receipt layouts with varied input.

Use this when: You need to organize several receipts into a reviewable expense log.

Human review: Confirm page boundaries, possible duplicates, totals, and expense-policy treatment.

➡️ Try this prompt in pdfFiller

Hypothetical example: A sales representative submits five travel receipts in one PDF. Prompt 8 keeps each transaction separate, calculates no currency conversions, and flags two same-day restaurant receipts for review rather than deleting either one.

Which prompts can extract data from forms?

Form data extraction prompts should connect every value to its field label and preserve checkboxes, radio buttons, and identifiers. pdfFiller also documents AI-assisted extraction from structured and unstructured business forms.

Completed and missing form fields

Prompt 9: Extract every completed form field

 

Read the attached completed form and list every visible field and entered value.

Return a response with:

  • Section
  • Field label
  • Entered value
  • Field type
  • Source page
  • Status

Use these field types where applicable: text, number, date, checkbox, radio button, dropdown, signature, initials, or other. Keep repeated fields as separate rows. Also respect repeated fields and preserve each one as a separate record. Do not combine first and last names, alter IDs, or normalize dates.

Use this when: You need a complete field-value inventory.

Human review: Check identity, contact, financial, employment, healthcare, and legal information against the original form before consequential use.

➡️ Try this prompt in pdfFiller

Prompt 10: Identify blank or incomplete fields

 

Inspect this form and identify fields that appear blank, partially completed, unreadable, or inconsistent with another field.

Return a response with:

  • Section
  • Field label
  • Issue type
  • Visible source text
  • Source page
  • Question for the reviewer

Distinguish between fields explicitly marked optional and fields whose requirement status is not stated. Do not assume an empty field is required. Do not fill, correct, or invent any answer. Blank-field detection is an iterative process when reviewers refine questions after the first pass. This helps catch form-completion errors before acceptance.

pdfFiller AI Assistant reviewing a document to identify blank text fields, checkboxes, and incomplete eSignature fields.

pdfFiller’s AI Assistant analyzes form fields and flags missing information, including blank text fields, unchecked boxes, and incomplete eSignature details.

Use this when: You need a follow-up checklist before accepting a completed form.

Human review: A qualified person must determine which fields are legally, contractually, or organizationally required.

➡️ Try this prompt in pdfFiller

Selections and identifiers

Prompt 11: Extract checkboxes and selected options

 

Extract every checkbox, radio-button group, dropdown selection, and yes-or-no response from this form.

For each option, report:

  • Question or group label
  • Option label
  • State: Selected, Not selected, or Unclear
  • Source page
  • Evidence note

List all visible options, not only the selected ones. If a mark overlaps multiple choices or is faint, use “Unclear.” Do not infer a selection from nearby text. Keep in mind that different models may interpret faint marks differently, so reviewers should compare results carefully when they evaluate outputs.

Use this when: Important form answers appear as marks rather than typed text.

Human review: Verify every selected option visually, especially when it affects eligibility, consent, coverage, or authorization.

➡️ Try this prompt in pdfFiller

Prompt 12: Extract contact details and reference numbers

 

Extract all names, organization names, postal addresses, email addresses, phone numbers, dates, account numbers, case numbers, application numbers, and other reference IDs from this form.

Return two columns for each value:

  1. “Source value” exactly as written
  2. “Standardized value” using these rules: [INSERT STANDARDIZATION RULES]

Implementing masking and standardization rules is crucial for sensitive identifiers. Add the field label, page number, and status. Preserve leading zeros. Mask sensitive identifiers in the standardized column as [INSERT MASKING RULE], but retain the source value only when my organization’s policy permits it. Do not guess missing characters.

Use this when: You need consistent contact or reference data while preserving the original entry.

Human review: Apply privacy, retention, and access rules before storing or sharing identifiers.

➡️ Try this prompt in pdfFiller

Structured form output

Prompt 13: Convert form responses into a reusable table

 

Convert this completed form into a structured table suitable for review before spreadsheet entry.

Use these columns:

  • Record ID
  • Section
  • Field name
  • Original response
  • Normalized response
  • Data type
  • Source page
  • Validation note

Use only these data types: text, integer, decimal, date, boolean, selection, or identifier. Apply these normalization rules: [INSERT RULES]. If no rule applies, copy the original response unchanged. For ambiguous fields, step-by-step reasoning techniques can improve extraction accuracy, but the final table should contain only the answer, not hidden reasoning. Do not merge repeated sections or assign a data type when the field is ambiguous.

Use this when: You need consistent rows from a completed business form.

Human review: Confirm the mapping between labels and responses before importing or relying on the table.

➡️ Try this prompt in pdfFiller

Hypothetical example: An operations coordinator reviews a supplier onboarding form. Prompt 9 creates the field inventory, Prompt 11 preserves each checkbox state, and Prompt 10 identifies an unreadable reference number for follow-up.

Which AI data extraction prompts help verify the output?

Verification prompts compare extracted values with visible evidence and isolate exceptions. They support human review but don’t certify that a document or dataset is correct.

Source comparison and exception handling

Prompt 14: Check extracted values against the source

 

Compare the extracted dataset below with the attached source document.

Extracted dataset:

[PASTE EXTRACTED DATA]

For every field, return:

  • Field name
  • Extracted value
  • Exact source value
  • Source page or section
  • Result: Match, Mismatch, Missing, or Unclear
  • Explanation

Compare character by character for names, IDs, account numbers, dates, quantities, and monetary values. Do not silently correct the dataset. After the table, list every item that requires human review. Teams can assess extraction performance over time by tracking match, mismatch, missing, and unclear rates across documents.

Use this when: You already have extracted data and need an evidence-based checking pass.

Human review: Resolve all mismatches against the source before the data supports a payment, filing, decision, or official record.

➡️ Try this prompt in pdfFiller

Prompt 15: Create an extraction exception report

 

Review this document and the extracted output below for extraction risks.

Extracted output:

[PASTE EXTRACTED OUTPUT]

Flag:

  • Missing requested fields
  • Unreadable or cropped text
  • Conflicting values
  • Duplicate records or line items
  • Totals that require recalculation
  • Values without a clear field label
  • Dates with an ambiguous format
  • Currency or unit ambiguity
  • Handwritten or overwritten entries
  • Content that may belong to another document

Some GPT models, including GPT-4o, have outperformed machine-learning baselines without labeled data in extraction-related tasks.

Return an exception table with the issue, affected value, source page, reason, and recommended human check. Use “No exception found” only when you can connect the value clearly to the source. Do not approve, reject, submit, or post the data.

Reported results include about a 22% improvement in entity resolution and a 17% gain in relation extraction F1 scores, but you should still evaluate exception handling on your own documents.

Use this when: You need a final quality-control queue rather than another clean-looking extraction.

Human review: Assign each exception to a person authorized to resolve financial, legal, employment, healthcare, tax, or compliance questions.

➡️ Try this prompt in pdfFiller

How can you use AI data extraction prompts in pdfFiller?

You can use pdfFiller’s AI Assistant, which uses generative AI and large language models to answer document-specific questions, extract process information, review cited responses, and continue working with the PDF. Feature availability may depend on the document and subscription.

  1. Upload the document or open it from your pdfFiller account.
  2. If the PDF is an image-based scan, use PDF AI text recognition before extraction.
  3. Open the AI Assistant and choose the option to ask about the document.
  4. Paste one prompt and replace only the bracketed instructions.
  5. Review the answer and its document references; these systems can work without extensive training data for each document type, but the output still needs review. pdfFiller’s Chat with PDF guide describes natural-language questions, cited answers, and context-aware follow-ups.
  6. Compare extracted values with the source and resolve every exception.
  7. Use the relevant pdfFiller features to edit, organize, share, or otherwise continue working with the reviewed document.
  8. Complete any required accounting, legal, compliance, or organizational review before signing, sending, submitting, or relying on it.

For more prompt patterns, see these AI prompts for pdfFiller. The pdfFiller AI Assistant FAQ also explains document chat, summarization, creation, scanned-PDF requirements, and current limitations.

Disclaimer: The information contained in this blog post is provided for general informational purposes only and does not constitute formal legal advice.

Final thoughts

Strong prompts for data extraction do more than name the fields you want. They define the structure, preserve source values, expose uncertainty, and create a clear review path.

Start with one invoice, receipt, or form. Choose the closest prompt, customize its fields and output format, and verify every important value before using the result. This introduction and the examples are meant to provide practical insights for evaluating prompt performance and adapting templates to your own workflows, and we hope they help. Then, try AI-assisted invoice data extraction in pdfFiller.

Glossary

  • AI data extraction: The use of artificial intelligence to identify and organize information from a document, often using large language models in natural language processing.
  • JSON: A structured text format often used to exchange data between systems.
  • Line item: An individual product, service, quantity, or charge listed on an invoice or receipt.
  • Normalization: Converting values to a consistent format while preserving the source data.
  • Optical character recognition (OCR): Technology that converts text in scans or images into machine-readable text.
  • Source reference: A page, section, or passage showing where an extracted value came from.

FAQ

1. Can AI extract data from a scanned PDF?
Yes, if the scan can first be converted into machine-readable text with OCR. Poor resolution, skewed pages, handwriting, and cropped content can still produce uncertain results, so compare the output with the scan.
2. Can AI extract information from handwritten receipts?
Some AI tools can recognize clear handwriting, but results vary with writing style, image quality, and layout. Treat handwritten amounts, dates, tips, and totals as review-required values.
3. What expected output format should I request for extracted PDF data?
Use a table for human review, CSV-ready rows for spreadsheets, and JSON for structured system workflows. Preserve the original values until a reviewer approves any normalization.
4. Can AI extract data from several invoices at once?
Some tools support batches, while others process one document at a time. When handling vast amounts of invoice data, keep one record per document and one row per line item whenever possible. Separate each invoice into a distinct record, retain page references, and check that line items weren’t mixed between documents.
5. How do I extract tables from a PDF into Excel?
Ask AI to return one row per source row with the original headers, units, and page numbers. Review merged cells, repeated headers, wrapped descriptions, and totals before moving the table into Excel.
6. How does AI handle non-standard document layouts?
AI may use labels, nearby text, and visual relationships to identify fields, but unusual layouts increase the chance of mismatched values. Request source references and flag any value without a clear label.
7. Is it safe to use AI for sensitive invoice or form data?
Review the provider’s current privacy, retention, access, and training policies, as well as your organization’s rules. Remove unnecessary personal, financial, healthcare, or identity data before processing whenever possible.
8. Can extracted invoice data be integrated with accounting software?
That depends on the AI tool and accounting system. Confirm supported formats or integrations, preserve leading zeros and currencies, and require a reviewed staging step before data enters the accounting record.