# Extract a table from a PDF to Excel

> Markdown version of https://stella.sh/how/pdf-excel/extract-table-from-pdf-to-excel for agents and LLMs.
> Get a multi-page PDF table into Excel with Tabula or Excel's Get Data, or let Stella (stella.sh) rebuild it as one clean sheet with prices as real numbers.

Excel for Windows (Microsoft 365) can import tables from a PDF: Data, Get Data, From File, From PDF. On a Mac, the free Tabula pulls tables out of text PDFs as CSV. Either way you usually still delete repeated headers, rejoin wrapped lines and turn prices back into numbers. Stella (stella.sh) does that clean-up too, so the sheet sorts and filters straight away.

- Checked: 14 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 14 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: One spreadsheet of 131 products in about 2 minutes. Checked afterwards against an answer key written before the run: every product code exactly once, trade prices and RRPs right (including those over £1,000) and stored as numbers, full descriptions with wrapped lines joined, pack sizes right, and no header, footer or stray rows in the table. The garden supplier and its price list are fictitious, made for this run as a text PDF. The work is sped up 6×.

Video (45 s): https://stella.sh/media/proofs/pdf-excel/extract-table-from-pdf-to-excel/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. A 4-page trade price list PDF from a garden supplier is in Downloads.
- 0:01 The prompt: put the product table in Excel so it sorts and filters, with prices as proper numbers.
- 0:11 Stella replies that it will save the file next to the PDF, with numeric prices and filters on the header.
- 0:16 Rebuilding the table across four pages, sped up 6×.
- 0:30 Done: 131 products, prices as numbers, a Category column, and two suspicious prices to ask the supplier about.

What Stella does:

1. Opens the supplier's 4-page trade price list in Downloads: a header and footer on every page, category headings between products, long descriptions that wrap onto a second line
2. Rebuilds the table from the positions of the words, so a wrapped description joins its own row instead of becoming a stray one
3. Turns the category headings into a Category column you can filter, and stores trade price, RRP and pack size as numbers (prices over £1,000 included)
4. Saves the spreadsheet next to the PDF with a frozen, filterable header row, and checks the row count and prices against the PDF
5. Points out two pairs of products with the same description but very different prices, and a few descriptions that already look garbled in the PDF

## The prompt to paste

```text
There's a PDF price list from our garden supplier in my Downloads. Put the product table into an Excel spreadsheet so I can sort and filter it, with the prices as proper numbers.
```

## Get the table out yourself

1. **Windows: Excel's PDF import.** In Excel for Microsoft 365, Data, Get Data, From File, From PDF. Pick the table for each page in the Navigator (or the one that spans pages), then Transform Data to remove repeated header rows, and Close & Load.
2. **Mac (or anywhere): Tabula.** Install the free Tabula, open the PDF, draw a box around the table on each page (or use Autodetect), and export as CSV. Open the CSV in Excel or Numbers.
3. **Clean up the rows.** Sort by the code column so repeated headers, category headings and stray wrapped lines bunch together. Delete them, but paste each wrapped line onto the end of the description it belongs to first.
4. **Make prices numbers.** If prices sit on the left of their cells or SUM gives 0, they're text. Use Find and Replace to remove “£” and the thousands commas, then Data, Text to Columns, Finish, which turns them into numbers.

## Where Stella stops

- This works on PDFs that hold real text. A scanned price list needs OCR first, which Stella can do, more slowly and with a closer check of every number.
- Stella copies what the PDF says, mistakes included; it flags values that look wrong but doesn't change them.
- The price list's text goes to the AI model you use in Stella; the spreadsheet is made on your computer.
- Recorded on Linux with free Python tools. On a Mac or Windows PC Stella uses the same kind of tool; the .xlsx opens in Excel, Numbers or Google Sheets.

## Questions

**Does Excel for Mac have Get Data from PDF?**
Not at the time of writing; the PDF connector is in Excel for Windows (Microsoft 365). On a Mac, use Tabula or another tool, then open the result in Excel.

**What about bank statements?**
Statements have their own catches (running balances, debits and credits). See [convert bank statement PDFs to Excel](https://stella.sh/how/pdf-excel/bank-statement-pdf-to-excel).

**Can I get just the text, not a table?**
Yes: [extract text from a PDF](https://stella.sh/how/pdf-excel/extract-text-from-pdf), which also handles scans.

**Is Stella free for this?**
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.

**Can I control what Stella changes on my computer?**
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.

Sources: [Tabula (free table extractor for text PDFs; Mac, Windows, Linux)](https://tabula.technology/), [Microsoft: Import data from a PDF (Power Query PDF connector)](https://learn.microsoft.com/en-us/power-query/connectors/pdf).

## Related problems

- [Convert bank statement PDFs to Excel](https://stella.sh/how/pdf-excel/bank-statement-pdf-to-excel.md)
- [Extract text from PDFs, including scanned ones](https://stella.sh/how/pdf-excel/extract-text-from-pdf.md)
- [Turn receipts into a spreadsheet for your expense report](https://stella.sh/how/pdf-excel/receipts-to-spreadsheet.md)
- [Convert Word tables to Excel (from one document or many)](https://stella.sh/how/pdf-excel/convert-word-table-to-excel.md)
- [Reduce PDF file size when it's too large to email](https://stella.sh/how/pdf-excel/compress-pdf-too-large-to-email.md)
- [Combine multiple Excel files into one sheet](https://stella.sh/how/pdf-excel/combine-excel-files-into-one-sheet.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
