To extract an invoice table from a PDF to Excel, first use the most structured source you have (a supplier export or embedded invoice XML), and only then import the PDF itself: as text if the table contains selectable text, through OCR if the page is a scan. Whatever the route, accept the spreadsheet only when every invoice line item appears once and the line net amounts add up to the subtotal printed on the invoice.
A PDF is a presentation format: it stores positioned text or page images, not rows and columns. The work is therefore to pick a starting point, turn it into rows, and prove that the rows match the document.
How do you extract an invoice table from a PDF, step by step?
- Look for structured data first. Ask the vendor (supplier) for an item-level CSV or Excel export, or check whether the PDF carries embedded XML. An export with only invoice dates and totals does not help a line-level task.
- Test the PDF type. Select one description and its amount, copy them into a plain-text editor and search for an item reference. Readable text means a text-based PDF; nothing selectable means a scanned page that needs OCR.
- Import the table. For a text PDF, use your spreadsheet’s PDF import, if your version has one, or copy the table into a working sheet. For a scan, run OCR on a working copy and keep the original.
- Rebuild one row per line item. Remove repeated column headings and carried subtotals, join wrapped descriptions to their item, and keep document fields (supplier, invoice number, page) in their own columns.
- Reconcile. Compare the number of item rows with the items visible on the PDF, then compare the sum of line net amounts with the printed subtotal before tax.
If you need this routinely rather than once, you can turn a PDF invoice into Excel rows with line-level checks and start from rows that already carry their page reference.
InvoiceLineLab extracts invoice line items from PDF to Excel or CSV: each product or service becomes its own row, with description, quantity, unit, price, net amount and the source page beside it, so step 5 starts from rows you can check against the PDF.
Which method fits your invoice PDF?
| Starting point | Method | What you still review |
|---|---|---|
| Item-level export or invoice XML available | Use the structured file | Columns present, units, credits, document context |
| Text-based PDF, simple table | Spreadsheet PDF import or copy-paste | Repeated headers, wrapped lines, numbers stored as text |
| Scanned PDF (image only) | OCR on a working copy | Misread characters, decimal marks, row grouping |
| Recurring invoices, mixed layouts | Dedicated invoice line extraction | Flagged values, page coverage, totals |
For a hybrid e-invoice, the embedded XML can be the best source, but its content depends on the declared profile: check whether the Factur-X XML contains line items before relying on it. According to FNFE-MPE, the MINIMUM and BASIC WL profiles carry document-level data, while BASIC adds core line information.
For a scan, OCR creates actual text from page images, and the W3C technique asks you to check that all text was recognized in the correct reading order. Recognition gives you characters; it does not decide which row a continuation belongs to. The scanned or text PDF diagnosis explains how to test each page before choosing.
What does a raw PDF import look like on a fictional invoice?
The synthetic invoice below has five line items over two pages. The raw import returns nine rows, because layout became data.
| Raw row | Page | Text | Qty | Unit price | Amount (EUR) | Decision |
|---|---|---|---|---|---|---|
| 1 | 1 | Copy paper A4, box of 5 reams | 10 | 24.90 | 249.00 | Item 1 |
| 2 | 1 | Toner cartridge, black | 2 | 68.50 | 137.00 | Item 2 |
| 3 | 1 | Archive boxes | 4 | 14.00 | 56.00 | Item 3 |
| 4 | 1 | natural board, pack of 10 | Join to item 3 | |||
| 5 | 1 | Carried forward | 442.00 | Exclude | ||
| 6 | 2 | Description / Qty / Price / Amount | Exclude (heading) | |||
| 7 | 2 | Brought forward | 442.00 | Exclude | ||
| 8 | 2 | Printed labels, 10% line discount | 3 | 18.00 | 48.60 | Item 4 |
| 9 | 2 | Delivery | 9.00 | Item 5 |
All figures are invented. Checks: 10 × 24.90 = 249.00; 2 × 68.50 = 137.00; 4 × 14.00 = 56.00; 249.00 + 137.00 + 56.00 = 442.00, which matches the carried amount. Labels: 3 × 18.00 = 54.00, minus 10% (5.40) = 48.60.
- Correct sum of line net amounts: 249.00 + 137.00 + 56.00 + 48.60 + 9.00 = EUR 499.60.
- Summing the raw amount column with both carry rows: 499.60 + 442.00 + 442.00 = EUR 1,383.60.
- With a fictional 20% VAT rate on the correct base: 499.60 × 0.20 = 99.92, so the total including tax is EUR 599.52.
Five item rows, one per printed item, and a line total equal to the invoice subtotal: that is the acceptance target. “Nine output rows” is not.
How do you extract line items, not only header fields?
Header fields (supplier, invoice number, date, total) are a handful of values per invoice; the item table is where rows wrap, split across pages and change layout from one vendor to the next. For analysis, purchase checks or a three-way match, you need the line items. Keep the two levels apart: one row per item, with the invoice number repeated beside it, and totals in a separate summary. The difference between invoice line items and header fields shows the column layout.
In Peppol’s invoice model, each invoice line has its own identifier, invoiced quantity, line net amount, item information and price. Those are useful column names for your sheet, even when the source is a PDF.
What should you check before using the Excel table?
Test each method on the same small sample rather than the cleanest invoice. Include a wrapped description, a multipage table, a credit note (credit memo), an item code with leading zeros and one poor scan.
| Sample case | Expected result | Reject or review if |
|---|---|---|
| Description wrapping onto a second line | One item with its quantity and amount | The continuation becomes a new purchase |
| Table across several pages | Every item once, with its page | Headers or carried totals become items |
| Item with no printed quantity | Quantity left blank and flagged | A zero or a guessed value appears |
| Item code with leading zeros | Code kept as text | “00451” becomes 451 |
| Line discount or credit | Original fields kept, sign explained | The discount is applied twice |
| Unreadable scanned page | Visible exception naming the page | The page silently yields zero items |
Totals alone cannot prove completeness: a missing EUR 15.00 item and a duplicated EUR 15.00 item cancel out. Count items per page as well. For repeated headers and carried subtotals across page breaks, classify each boundary row before deleting it.
When is a dedicated extraction tool worth it?
For one short text invoice, a carefully checked copy-paste is often enough. A dedicated tool pays off when invoices recur, layouts vary and the time goes into cleanup and review rather than conversion. Compare routes on the whole task: setup, cleanup, review and export, plus the price on its stated billing unit (per document or per page). A route that converts in seconds but needs fifteen minutes of correction per invoice can cost more than a slower, cleaner one.
Before sending invoices to any service, check its documented handling and retention terms against your own requirements. InvoiceLineLab bills per PDF page on a single monthly plan, the synthetic invoice example shows the target rows with their review notes, and invoice data validation line by line lists the checks applied to each row.
Once the rows exist, reconcile the line totals with the amount payable: discounts, shipping, tax and prepayments sit at document level.
FAQ
Can Excel import a table directly from a PDF?
Some spreadsheet versions include a PDF import among their data import tools; availability depends on version and platform. It needs a text-based PDF and still requires cleanup of headers, wrapped lines and number formats.
Why does my PDF table land in one column in Excel?
The PDF stores positioned text, not cells. A simple paste loses the column boundaries; an import tool or a text-to-columns step has to rebuild them, and you should check alignment on every page.
How do I extract data from a scanned PDF invoice to Excel?
Run OCR on a working copy, then compare codes, quantities and decimal marks with the page image. Keep the original PDF and mark any page that could not be read.
Is matching the invoice total enough to validate the extraction?
No. Compare item counts per page and check boundary rows too: offsetting errors, such as one missing item and one duplicated item at the same price, leave the total unchanged.