# Extract Tables From Tax PDF Statements Into Excel

- Canonical: https://schematax.com/blog/extract-tables-from-tax-pdf
- Author: Schema Tax (https://schematax.com)
- Published: 2026-10-11T06:15:48.000Z
- Updated: 2026-10-11T06:15:48.000Z

To extract tables from a tax PDF, find the detail pages first, then pull each table into one range with a single header row. Drop the repeated headers and the subtotal rows that page breaks add, give every column a name and a type, and confirm the sum of the clean range matches the printed total.

## Where tables hide in tax PDFs

Tables in tax PDFs live on the pages after the summary boxes. A brokerage statement, a consolidated 1099 or a K-1 package often opens with a page of boxed totals and follows it with pages of rows: one row per sale, per payment or per line item. Those rows are the tables worth extracting.

The brokerage statement is the most common case. The [IRS Instructions for Form 1099-B](https://www.irs.gov/instructions/i1099b) tell brokers to "report each transaction" on its own form for most securities, and they say a broker may be able to report a customer's transactions for the year "on a single substitute statement." In practice, that substitute statement is a long table, one row per sale, with columns that match the form's boxes.

The column headings on that table usually follow the 1099-B box names. The same instructions title them "Box 1a. Description of Property," "Box 1b. Date Acquired," "Box 1c. Date Sold or Disposed," "Box 1d. Proceeds" and "Box 1e. Cost or Other Basis." A statement may shorten the labels, but the order often matches.

Other places tables appear:

- Supplemental pages of a consolidated statement that list dividends or interest by security.
- Schedules attached to a K-1, which list items too long for the form's own lines.
- Year-end mortgage or escrow detail pages that some lenders add after the 1098 summary.
- Statements attached to a 1040, such as a list of other income items.

The boxed summary page is not a table in this sense. A W-2 or a 1099-NEC is a grid of labeled boxes, and reading it is a field extraction job, which the post on [PDF tax form data extraction](/blog/pdf-tax-form-data-extraction) covers. The rest of this post is about the row-by-row pages. Lot-level details such as wash sales and covered status belong to the [1099-B brokerage category](/blog/category/1099-b-brokerage).

## Why do tax PDF tables split across pages?

Tax PDF tables split across pages because the statement was laid out for printing. When rows reach the bottom of a page, the layout starts a new page, repeats the column header, and often prints a subtotal for the rows above. Each of those additions becomes an extra row once the table lands in a spreadsheet.

A PDF does not store a table as a table, only characters at positions, so an extraction tool has to rebuild rows and columns; the post on [what a PDF to Excel converter sees on a tax form](/blog/why-pdf-to-excel-converters-break-tax-forms#what-a-pdf-to-excel-converter-sees-on-a-tax-form) covers why.

That rebuild meets three kinds of page-break noise:

- Repeated headers. The column titles print again at the top of each page. After extraction, the second page starts with a row of text where numbers should be.
- Page subtotals. Some statements print a "Page total" or "Subtotal" row before the break. Summing the whole column counts those rows twice.
- Carried-forward lines. Some layouts print a "Balance forward" row at the top of the next page that repeats the running total.

Rows can also break in the middle. A long security description may wrap to two lines, and a page break can land between them. The first half sits at the bottom of one page, the second half at the top of the next, below the repeated header.

Footers and page numbers add more noise. A line such as "Page 2 of 6" or an account number in the footer can be picked up as a row with one filled cell.

## PDF table extraction tools: three kinds

PDF table extraction tools fall into three kinds: text-layer tools that rebuild tables from character positions, OCR tools that first turn page images into characters, and form-aware tools that know what a tax statement should contain. Each fails in a different way on tax tables, so the kind matters more than the brand.

### Text-layer tools

A text-layer tool reads the characters already stored in a digital PDF and groups them into rows and columns by position. The [pdfminer.six documentation on converting a PDF to text](https://pdfminersix.readthedocs.io/en/latest/topic/converting_pdf_to_text.html) describes this kind of grouping: characters that are "horizontally and vertically close are grouped onto one line." This works well on clean, digital statements with wide column gaps. It fails on scanned pages, which have no characters to read, and it can merge two columns when the gap between them is narrow.

### OCR tools

An OCR tool runs optical character recognition on a page image and then applies the same kind of grouping. It is the only option for a scanned or photographed statement. The [OCRmyPDF introduction](https://ocrmypdf.readthedocs.io/en/latest/introduction.html) is direct about the limits of one open-source engine: "Poor quality scans can result in subpar OCR quality," and the engine "may struggle to analyze the natural reading order of documents." On a table, a misread digit or a misplaced column is the usual result.

### Form-aware tools

A form-aware tool knows that a 1099-B detail table has a proceeds column and a cost basis column, and maps what it reads to those names. It can drop repeated headers because it expects them, and it can test the result against the statement's own totals. The trade-off is scope: it only knows the statement types it was built for.

| Tool kind | Input it needs | Typical failure on tax tables |
| --- | --- | --- |
| Text-layer | Digital PDF with a text layer | Merged columns, blank output on scans |
| OCR | Any page image | Misread digits, columns out of order |
| Form-aware | Supported statement types | Unknown layouts outside its list |

Generic converters that turn every page into a sheet are a fourth thing, closer to the first kind with no table logic at all. The post on [why PDF to Excel converters break tax forms](/blog/why-pdf-to-excel-converters-break-tax-forms) shows what they do to a boxed form, and its section on [merged cells and split numbers](/blog/why-pdf-to-excel-converters-break-tax-forms#merged-cells-and-split-numbers-from-converted-tax-forms) explains the cell damage.

## Mapping tax PDF table columns to spreadsheet headers

Mapping tax PDF table columns to spreadsheet headers means giving each extracted column one fixed name and one data type. A name such as `proceeds` instead of "Proceeds ($)" lets formulas and code find the column across years. A type such as date or currency lets the spreadsheet sort and sum it correctly.

Pick names that follow the form, not the statement. Two brokers may print "Sale Proceeds" and "Gross Proceeds" for the same box. Both map to one column, such as `box_1d_proceeds`. That way, statements from different sources stack into one sheet without a second cleanup pass.

Set the type of each column before you check totals:

- Dates. Convert "03/14/26" and "2026-03-14" to real date values, so the date acquired and date sold columns sort and compare.
- Amounts. Strip dollar signs and thousands separators, and turn parentheses into negative numbers, so (125.00) becomes -125.00.
- Text. Keep descriptions and CUSIP-style identifiers as text, so leading zeros survive.
- Codes. Keep letter codes in their own text column instead of appending them to an amount.

Watch for the word "Various" in a date column. Some statements print it when a lot was bought on several dates. It is a valid value, not an error, but a date column that rejects text will drop it. Keep it as text in its own column, or keep the column as text.

Schema Tax reads 1099-B pages into a fixed schema, with dates acquired and sold, proceeds, cost basis and wash sales for every lot, and exports the result to [Excel, CSV or JSON for the supported forms](/#forms). The column names stay the same no matter which broker issued the statement.

## Subtotal and footnote rows to drop from a tax PDF table

Subtotal and footnote rows in a tax PDF table are lines that describe other rows instead of recording a transaction. Summing them with the real rows double counts amounts. Drop them from the clean range, but keep their printed values somewhere, because the printed totals are what you check the clean range against.

Rows to drop:

- Repeated column headers at the top of each page.
- "Page total," "Subtotal" and "Balance forward" rows.
- Section titles such as "Short-term transactions for covered securities."
- Footnote lines such as "* Wash sale adjustment included."
- Page numbers, account numbers and other footer text.

A quick way to find them is to sort the amount column. Text rows sort to one end. Rows whose amount equals the sum of the rows above are likely subtotals. A row with only one filled cell is often a wrapped description that belongs to the row above it.

Section titles carry information even though they are not rows. The 1099-B instructions say covered short-term, covered long-term and noncovered securities go on separate forms. A statement that groups its table under those headings is telling you the category of each row. Before deleting a section title, add its meaning as a column, such as `term` with values "short" and "long."

### A before and after with fictional values

The statement below is fictional. It shows two pages of a sales table, with a repeated header, a page subtotal and a grand total.

Before, as extracted:

| Description | Date sold | Proceeds | Cost basis |
| --- | --- | --- | --- |
| 10 sh EXAMPLE CORP | 02/11/26 | 1,250.00 | 1,100.00 |
| 25 sh SAMPLE FUND | 04/02/26 | 3,480.50 | 3,900.00 |
| 5 sh DEMO INC | 06/19/26 | 912.25 | 850.00 |
| Page subtotal | | 5,642.75 | 5,850.00 |
| Description | Date sold | Proceeds | Cost basis |
| 8 sh PLACEHOLDER CO | 09/08/26 | 2,105.00 | 2,000.00 |
| 12 sh TEST TRUST | 11/30/26 | 640.40 | 700.00 |
| Total | | 8,388.15 | 8,550.00 |

After cleanup, the range holds five rows: the three lots from page one and the two from page two. The proceeds column sums to 8,388.15 and the cost basis column to 8,550.00. Both match the printed total row, so the extraction is complete.

## Can an extracted tax table be trusted without a total check?

An extracted tax table should not be trusted without a total check. A missing row, a duplicated row or one misread digit all leave a table that looks normal. Comparing the sum of the clean range to the total the statement prints is the fastest test that catches all three.

The check is a subtraction. Sum each amount column in the clean range, then subtract the printed total. A difference of zero means every row is present once and every amount was read the same way the statement printed it. Any other difference points at the problem.

The size of the difference is a clue:

- A difference equal to one row's amount means a row was dropped or counted twice.
- A difference equal to a page subtotal means a subtotal row was left in.
- A difference of 9, 90 or 900 often means two digits were swapped or a 1 was read as a 7.
- A difference in cents only can mean a rounding column or a misplaced decimal.

Run the check per section, not only on the grand total. Two errors in opposite directions can cancel at the bottom line but show up within one section. When a statement prints a total for each group of transactions, each one is a free test.

A summary page is a second check. The boxed summary at the front of a consolidated statement often reports totals for the detail pages. If the clean table matches the detail total but not the summary, check whether the summary covers more categories than the table you extracted.

A total check proves the table matches the statement. It does not prove the statement is right. A broker that reported a wrong cost basis printed a wrong total too, and the two will agree. Checking the figures against your own records is a separate step that no extraction can do for you.
