RoRoTo
On-device

PDF to Markdown: what actually survives

Headings mostly survive. Tables almost never do. Here is what the conversion is really doing, and why it breaks the way it does.

A PDF does not contain a document. It contains instructions for drawing one: put this glyph at this coordinate, then that glyph 3.7 points to the right. There is no paragraph element, no heading level, no table. Everything you see as structure is an impression produced by geometry.

So "PDF to Markdown" is not a translation. It is an inference. The converter reads positions and guesses what they were meant to be. Understanding that guess is the difference between output you can use and output that quietly poisons a retrieval pipeline.

Why the text comes out in the wrong order

PDF text is stored in drawing order, which is whatever order the producing software wrote it — usually the order the author typed, but sometimes not. Converters therefore re-sort glyphs by position: group them into lines by baseline, then order lines top to bottom.

That works for a single column and falls apart for two. In a two-column academic paper, the converter sees two blocks of text at the same vertical position. Which one comes first? Left, usually — but the moment a figure caption spans both columns, or a footnote sits mid-page, the reading order inverts for a page or two. The text is all there; the sentences are interleaved.

Detecting the problem takes ten seconds: read the first paragraph of every page in the output, not just page one. If a sentence jumps mid-clause to an unrelated topic and comes back two lines later, the column detection failed.

Headings are guessed from font size

A real heading in Markdown is a claim about hierarchy. A PDF only offers font size and weight, and those are not consistent even inside one document — a cover title, a chapter title and a pull quote can share a size.

Most converters use a threshold: text above some size becomes #, the next band becomes ##, body text stays plain. That produces reasonable output on reports and clean failures on design-heavy pages, where a large decorative number becomes a heading and a real ## in bold 11pt stays body text.

If your document has a table of contents, it is worth checking whether the heading levels in the output match the TOC depths. That is the cheapest audit available, and it catches band-threshold errors immediately.

Tables are where it fails hardest

A table in a PDF is not a table. It is a set of horizontal and vertical lines plus text positioned between them. Nothing declares "these four cells belong to one row".

Converters reconstruct rows by clustering glyphs on the same baseline and columns by x-position. This works when the grid is strict, and degrades in exactly the cases that matter: merged cells, wrapped cell text, numbers right-aligned while headers are centred, and tables that continue across a page break.

ElementSurvives?Typical failure
Body textYesColumn order, hyphenated line breaks
HeadingsMostlyWrong level when font sizes repeat
ListsSometimesBullets lost, items merged into one paragraph
TablesRarelyCells shift by one column; merged cells collapse
FiguresNoOnly alt-text-free nothing; captions survive as text
FormulasOnly if typedSub/superscripts flatten; image formulas vanish
FootnotesUsuallyLand inline, mid-sentence

If tables are the reason you are converting, do not trust the output — re-key the table from the original, or extract it separately and merge. A table off by one column is worse than no table, because it looks correct.

The hyphen problem, and three other silent corruptions

  • Soft hyphens. A word broken across lines arrives as trans- plus former. Join them and you get trans-former; split them and you get two tokens. Good converters guess; none guess perfectly, and code identifiers like get- and Element are where the guess goes wrong.
  • Ligatures. Typographic fi and fl are single glyphs in the font. Extracted carelessly they become nothing, or a replacement character.
  • Running heads and page numbers. They are text, so they land in the body. In a 200-page document that is 200 stray lines that will be embedded, retrieved and cited as content.
  • Invisible text. Scanned documents that were OCR'd once already carry a text layer that may be worse than OCR-ing again from scratch.

Why Markdown is worth the trouble for retrieval

If the output is going into a language model, plain text would be smaller and simpler. Markdown earns its place for one reason: headings give a chunker something to cut on.

Splitting a document into fixed 1,000-token windows slices through sections at random. Splitting on ## keeps each chunk inside one topic, and — this is the part that matters — lets you prefix each chunk with its section path (Report > Q3 revenue > Europe). That prefix is often the only thing that tells the model what a chunk is about, because the chunk itself starts mid-thought.

So a converter that gets headings right and tables wrong is more useful than one that gets everything mediocre. Structure first, fidelity second.

Doing it without uploading the document

Contracts, medical records and internal reports are the documents people most want converted, and they are the ones that should never touch a server. The conversion is pure text manipulation over a file you already have — it does not need a backend.

  1. Open PDF to Markdown and drop the PDF in. Nothing is sent anywhere; the parsing happens in the tab.
  2. Set the page range if you only need a section — conversion time scales with pages.
  3. Read the first page of the output before using the rest. If the column order is wrong there, it is wrong everywhere.
  4. Copy the Markdown, or download it as .md. The section headings are your chunk boundaries later.

Two honest limits. A scanned PDF has no text layer, so this tool will return almost nothing — run OCR first to add one. And images are not described: a chart becomes a caption and silence. If the figures carry the argument, the Markdown will not.

Check before you trust

Run these three checks on any converted document before it enters a pipeline:

  • Count the headings against the source's table of contents. A mismatch means font-size banding failed.
  • Search for a hyphenated word you know appears across a line break. If it is split into two tokens, the join logic is off.
  • Grep for the page footer text. If it appears 200 times, strip it before chunking, or every chunk will share the same noisy prefix.

Frequently asked

Does the conversion keep images and charts?

No. Markdown from a PDF contains the text layer only — figures are dropped, and their captions survive as ordinary paragraphs. If the figures carry meaning, keep the original PDF alongside the output.

Can it convert a scanned PDF?

Not usefully. A scanned page is an image with no text layer, so there is nothing to extract. Run OCR first to add an invisible text layer, then convert; expect recognition errors in the result.

Why are tables always broken?

Because a PDF table is not a table. It is lines plus positioned glyphs, with no declaration of which cells share a row. Reconstruction is positional guesswork, and merged cells, wrapped text and page-spanning tables defeat it.

Is the file uploaded anywhere?

No. The PDF is parsed in the browser tab and never leaves the device — there is no upload endpoint to send it to. That is also why very large documents take as long as they take: the work is happening on your machine.

Tools mentioned

Published 2026-11-14 · All guides