PDF Table to Markdown: How to Convert Tables That Survive

A clean PDF table converts to a Markdown pipe table reliably; a table with merged cells, multi-line rows, or no ruling lines will break in any converter — and the fix is rebuilding those rows by hand, not switching tools. Tables are the most fragile element in PDF-to-Markdown conversion, because PDF stores them as positioned text, not as a table. Below: why they break, three conversion paths compared, and a repair workflow for the output you already have.

Why PDF tables break during conversion (the mechanical reason)

PDF has no table structure. What looks like a table to you is, in the file, a set of text fragments at x/y coordinates plus optional drawn lines. Every converter must reconstruct the table from geometry — so the difficulty depends entirely on how the table was authored:

Three conversion paths compared

PathBest forWhere it fails
General PDF→MD converters (online or local)Ruled tables, straightforward reportsMerged cells, borderless layouts — output becomes run-on text or broken pipes
Table-extraction tools (camelot for Python, mutool draw -F table)One hard table you need exactly rightStill outputs a grid you must reformat into Markdown pipes yourself; worse for borderless tables
Manual copy from the PDF viewerSmall tables (≤10 rows)Copy-paste from most viewers yields tab-separated cells — usually recoverable, sometimes scrambled reading order

Practical default: run the whole PDF through your PDF-to-Markdown converter first, then check the tables. If they survived, done. If not, extract just those tables from the original PDF individually — no need to reprocess the whole document.

Mark table output that looks like this? Repair instead of re-converting

Common broken outputs and the fast fix for each:

  1. Everything on one line with no pipes — the converter didn't detect a table at all. If columns are consistently spaced in the original, the fastest fix is copying the table from the PDF viewer into a spreadsheet (it usually pastes into columns), then exporting the spreadsheet as Markdown (Google Sheets via add-on, or Excel 365's built-in Markdown table copy).
  2. Pipe table exists but rows shifted / columns misaligned — usually caused by multi-line cell content: a value that wrapped onto two lines in the PDF became two table rows. Merge the split rows by hand; this is always faster than re-running a different converter.
  3. Header row missing or duplicated — the converter treated a repeated header (on page 2 of the table) as data. Delete the duplicates, keep one header line.
  4. Merged cells flattened into repeated values — Markdown has no merged cells. Decide: keep the repeated value in every row (most honest), or restructure as two smaller tables.
  5. Numbers lost their alignment or thousands separators — visual-only loss; Markdown doesn't support column alignment beyond :--- syntax. Add alignment markers in the header row (|:---|---:|) for left/right alignment if your renderer supports it.

What about tables with images inside?

Pure Markdown cannot embed an image inside a table cell. Converter output will typically put the image reference before or after the table, or as a broken tag inside a cell. If the table's meaning depends on the images (e.g., a legend column), convert the images to standalone figures and reference them by number in the cell text — that's not a converter bug, it's the format's limit.

Prevention: pick source documents that convert cleanly

If you control the source: export the table from its originating application (Excel, Word, HTML) directly to Markdown or CSV instead of routing it through PDF. PDF is a print format — every table that travels through it gets flattened to geometry first. The PDF→Markdown step can only recover what the PDF flattened, which is why what survives conversion differs so much from table to table.

FAQ

Why does my converted PDF table look broken?

Almost always one of: merged/threaded cells (pipes exist but rows shifted), borderless layout (no pipes at all), or a table split across pages (duplicated or missing headers). Match your symptom to the numbered fixes above.

How do I copy a table from PDF and keep the columns?

Select in the PDF viewer, paste into a spreadsheet rather than a plain-text editor — spreadsheets split pasted text into columns by spacing in most cases. Then export from the spreadsheet to Markdown.

Can Markdown tables have merged cells?

No. Standard Markdown pipe tables are strictly rectangular. Use repetition, split tables, or an extended format like HTML-in-Markdown if your renderer allows it.

Which PDF converter handles tables best?

For ruled tables, most mainstream converters are close. For borderless or merged-cell tables, none handles them losslessly, because a Markdown pipe table cannot represent them — plan on the manual repair steps above regardless of tool choice.

Related: what survives conversion and what breaks · the full PDF-to-Markdown walkthrough · try the in-browser converter