Convert PDF Tables to Markdown

Tables are the hardest thing to get out of a PDF intact, because a PDF has no idea it contains one. There are no rows, no cells, no borders in the data — only text placed at coordinates that happen to line up. Recovering a table means detecting that alignment.

How do I extract a table from a PDF into Markdown?

Drop the PDF onto the converter on this page. Text that aligns into consistent columns across consecutive rows is detected as a table and rendered as a GitHub Flavored Markdown pipe table.

Why does copying a PDF table give me a jumbled mess?

Copying returns text in the order it was drawn, not in reading order, and PDFs contain no cell boundaries. Column structure has to be reconstructed from x-coordinates, which copy and paste does not attempt.

Drop your PDF here

or choose a file from your computer

PDF only · up to 50 MB

How to convert a PDF table to Markdown

  1. 1

    Convert the document

    Drop the PDF onto the converter. Tables are detected automatically alongside the rest of the document.

  2. 2

    Check the column count

    Compare the preview against the original. A column that is consistently empty usually means a header spanned two columns in the source.

  3. 3

    Fix any stragglers

    Edit the Markdown directly in the left pane. Pipe tables are plain text, so adding or merging a cell is a small edit.

  4. 4

    Copy into your destination

    Paste the table into GitHub, Obsidian, a README, or a docs site. GFM pipe tables render in all of them.

How the table detection works

Every text run in a PDF carries an x-coordinate and a width. The converter splits each line wherever the horizontal gap between two runs is wider than roughly one and a half times the body font height, which is far wider than word spacing but narrower than a column gutter.

That alone would misfire on justified paragraphs, which also contain wide gaps. So the detector adds a second requirement: the gaps have to land in the same place on consecutive lines. Random word spacing never aligns across rows; a real column always does.

A block is only emitted as a table when at least two consecutive rows share at least two recurring column positions. Everything else stays as paragraph text.

What survives and what does not

Markdown's table syntax is deliberately minimal, which sets a hard ceiling on what any converter can preserve.

  • Preserved: column structure, row order, cell text, and inline bold or italic within a cell
  • Preserved: the first row is treated as the header, matching how nearly all documents lay out a table
  • Lost: merged cells, which have no Markdown equivalent and flatten into the leftmost column
  • Lost: nested tables, cell background colours, borders, and column widths
  • Approximated: a cell whose text wraps onto several lines is joined into one cell

When detection struggles

Tables without consistent column alignment — where cells are centred individually, or where a column of numbers is right-aligned against a left-aligned neighbour with a narrow gap — are the difficult case. The detector is tuned to prefer leaving text as paragraphs over inventing a table that was never there, because a wrong table is harder to clean up than plain text.

Financial statements, price lists, specification sheets and comparison tables generally convert well. Dense forms with boxed fields generally do not, since their structure comes from drawn rectangles rather than from text alignment.

Frequently asked questions

Can I extract only the tables and skip the rest?
Not automatically. The whole document is converted, with tables in place. Since the output is plain text, deleting the surrounding paragraphs takes seconds.
What about tables that span several pages?
Each page is detected separately, so a table continuing across a page break produces two tables. Merging them is a matter of deleting the repeated header row.
Does it handle right-aligned number columns?
Usually. Detection clusters cells by their left edge, so a right-aligned column of varying-width numbers can occasionally split. Check totals against the source.
Can I get CSV instead of Markdown?
Not currently. A Markdown pipe table converts to CSV easily in a spreadsheet or with a short script, and CSV export is on the roadmap.

Related converters