How PDF to Markdown works: a whole converter in your browser.
A tour of the converter’s features — and the heuristic pipeline that turns a PDF’s positioned text into clean Markdown headings, lists, and paragraphs, without uploading a single byte.
A PDF is a stubborn thing to read by machine. It records where every glyph sits on a page, in what font and size — but not that one line is a heading and the next three are a paragraph. The PDF to Markdown converter rebuilds that lost structure heuristically, and it does the whole job in your browser. This post covers what it can do, then opens the hood on how the conversion actually works.
What the converter does
Everything below happens on the page you have open — there is no upload step, no processing queue on a server, and no account.
Add a PDF any way you like
- Drop, browse, or paste. Drag files in, click to browse, or paste a copied PDF with
Ctrl/Cmd + V. Documents up to 100 MB each are supported. - Batch, safely. Drop a whole folder and the files queue up. They convert one at a time so a big batch never freezes the tab, each showing its own waiting, converting, and done status.
- From a URL — even CORS-blocked hosts. Paste a link and it fetches in your browser. When a host blocks cross-origin downloads, a small same-origin proxy retrieves the public file so the conversion still works. One-click sample PDFs let you try it instantly.
Structure it rebuilds
- Headings reconstructed from font sizes, so chapter and section titles keep their hierarchy.
- Lists — bulleted and numbered lines become proper Markdown lists, with ordered lists keeping their original numbering.
- Cleaner text — repeated page headers, footers, and standalone page numbers are stripped; wrapped and hyphenated lines are stitched back into flowing paragraphs; bold and italic runs are re-emphasized; bare URLs are auto-linked.
Read it, check it, export it
- Side by side. Open the original PDF in a panel beside the Markdown to proofread the result page by page.
- Preview or raw. Flip between a rendered preview and the raw Markdown, or expand the workspace to fullscreen.
- Export. Copy it, download the
.md, print it, or open it in the full Markdown Viewer editor.
How it works: from PDF to Markdown in six passes
The converter feeds on the text content pdf.js extracts for each page: positioned text runs, each a bit of text with a transform matrix (where it sits), a width, and a font reference. From that raw material, six passes rebuild a document.
- Resolve fonts to emphasis. Each font is mapped to an inline format — bold or italic — from its name. The font whose glyphs cover the most text is treated as the plain body face, so a document set entirely in a
…-Boldbody font does not come out all bold. - Group runs into lines. Runs are gathered into visual lines by baseline (vertical) proximity, keeping each run’s formatting as a segment of the line.
- Drop page furniture. Short lines near the top and bottom edges are fingerprinted; anything repeated across most pages — running headers and footers — or matching a page-number pattern is removed.
- Learn the body size and spacing. The most common font size becomes the body baseline, and the typical line spacing is measured — the calibration that makes paragraph detection work across different documents.
- Map sizes to headings; find lists. Sizes larger than the body baseline map to heading tiers (H1–H6), and bullet (
•,-) and numbered (1.) markers are detected as list items. - Rebuild paragraphs, emit Markdown. Consecutive body lines are merged into paragraphs — repairing words split by a hyphen at a line break — then written out as Markdown with inline
**bold**and_italic_and auto-linked URLs.
Why font size, not tags
This is the crux of every PDF to Markdown converter. A web page has <h1> and <ul> elements that say what each block is. A PDF has none of that. It has a glyph placed at an x/y coordinate, in a named font, at a size — pure visual layout. The only reliable signal that a line is a heading is that it is bigger than the text around it, so the converter learns each document’s own body size rather than assuming a fixed number.
The same reasoning drives the small repairs that make output readable. A PDF wraps a paragraph across many short lines with no marker to say they belong together, so the converter re-joins body lines using the measured line spacing. When a line ends in conver- and the next starts with sion, it removes the hyphen and fuses the word; across a page break, a paragraph only continues when the sentence was left unfinished.
[24pt] Quarterly Report → # Quarterly Report
[11pt] Revenue grew across all → Revenue grew across all
[11pt] regions this quarter. regions this quarter.Where it runs — and what stays private
The parsing engine is Mozilla’s pdf.js, which reads the document inside a Web Worker in your tab. The conversion logic itself is pure and framework-agnostic — it takes the extracted text and returns a Markdown string, and is unit tested without pdf.js at all. Your file is read locally and converted locally.
Fetching a PDF from a CORS-blocked URL routes through a same-origin proxy that retrieves that public file. Your own dropped, pasted, and browsed files are never sent anywhere.
The honest limits
Because structure is reconstructed from visual cues, some inputs are genuinely hard:
- Scanned PDFs are images of text with nothing to extract — run them through OCR first.
- Password-protected PDFs can’t be parsed; remove the password first.
- Complex multi-column layouts and heavy tables may need manual cleanup. Simple, single-column documents convert very cleanly.
The output is meant to be a strong first draft you can tidy in place — and since the Markdown stays fully editable in the workspace, the side-by-side PDF makes those touch-ups quick.
Frequently asked questions
Is my PDF uploaded to a server?
No. The PDF to markdown conversion runs entirely in your browser tab using Mozilla’s pdf.js. The file is read locally, converted locally, and never transmitted — safe for contracts, research papers, and internal reports.
How does the converter know what is a heading?
A PDF stores glyphs at coordinates, not heading tags. The converter learns the document’s body font size, then maps larger sizes to heading tiers (H1–H6). It also detects bulleted and numbered list markers and rebuilds wrapped lines into paragraphs.
Can it convert a scanned PDF to markdown?
Not directly. A scanned PDF is an image of text with nothing to extract. Run it through an OCR tool first to produce a text-based PDF, then convert that PDF to markdown here.
Why do some PDF URLs need a proxy to fetch?
The browser fetches CORS-friendly URLs directly. When a host blocks cross-origin downloads, a small same-origin proxy fetches the public PDF so the conversion still works — your own local files never go through it.
Try it