AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert a PDF to Markdown?

Drop a PDF onto AnyTool PDF to Markdown and it extracts the text and converts it to clean Markdown right in your browser. Using pdf.js, the tool reads the position and font size of every piece of text, rebuilds the lines, and then infers structure: lines whose font is noticeably larger than the body text become #, ## or ### headings, bullet and numbered lines become Markdown lists, bold text is wrapped in **…**, and soft-wrapped lines are merged back into flowing paragraphs (with hyphenated words rejoined). You get the raw Markdown to copy or download as a .md file, plus a sandboxed rendered preview. Everything runs locally with a bundled pdf.js worker — no upload, no CDN, no server — so your PDF never leaves your device.

  • Extracts a PDF’s text layer to clean Markdown in your browser
  • Headings inferred by relative font size; lists and bold detected
  • Soft-wrapped lines merged into paragraphs; hyphenation rejoined
  • Raw .md to copy/download plus a sandboxed live preview
  • 100% client-side — bundled worker, no CDN, no upload, works offline

What is

PDF to Markdown Conversion

PDF-to-Markdown conversion extracts the text from a PDF and re-expresses it as Markdown — a lightweight plain-text format with simple symbols for headings (#), lists (- / 1.) and emphasis (**bold**). Because a PDF stores only positioned glyphs and no semantic document model, a converter must reconstruct lines from each glyph’s coordinates and font size and then heuristically infer headings, lists and paragraphs. The result is LLM-friendly, version-control-friendly, plain-text content; scanned (image-only) PDFs have no text layer and require OCR first.

Converters

Related terms

MarkdownPDFpdf.jsText ExtractionOCRLLM-Ready Content

Frequently Asked Questions

Nothing is uploaded. The PDF is read and converted entirely in your browser with a bundled pdf.js worker, so it never leaves your device.

AnyTool PDF to Markdown is 100% client-side. When you choose a PDF, your browser reads the file locally and pdf.js extracts the text on your own machine — using a worker that is bundled into the app rather than fetched from a CDN. No file is sent to any server, there is no account or tracking, and the tool keeps working offline after the first load, which makes it safe for confidential documents.

It measures the document’s body font size and flags lines whose font is meaningfully larger as headings — bigger jumps become #, smaller ones ## or ###.

A PDF doesn’t store headings, so the tool infers them. It reads the font size of every text run, takes the median size across the document as the body text, and then compares each reconstructed line to that baseline: roughly 1.8× and above becomes an H1 (#), about 1.45× an H2 (##), and about 1.18× an H3 (###). Very long lines and obvious list items are excluded so body text isn’t mistaken for a heading. You can switch heading detection off entirely if you prefer plain paragraphs.

No. A scanned PDF is made of page images with no text layer, so there is nothing to extract — OCR is required first, and this tool does not OCR.

This converter reads a PDF’s existing text layer. A scanned or photographed PDF contains only images of the page, with no selectable text, so the tool detects that zero text was found and tells you the file looks scanned and needs OCR (optical character recognition) to recover the words. Run such a PDF through an OCR step first; for normal, text-based PDFs the extraction is fast and accurate.

Plain text, headings, lists and paragraphs convert well; tables and side-by-side columns are approximated, and the tool warns you when it sees them.

Because the tool reconstructs structure from glyph coordinates, simple documents convert cleanly. Complex layouts are harder: text is read in geometric order, so a multi-column page can interleave columns, and tables are flattened to text rather than rebuilt as Markdown tables. The tool surfaces an honest warning when it detects a likely multi-column or complex layout so you know which parts to review and fix.

Detailed Explanation

Methodology

How the PDF to Markdown Converter Works

AnyTool PDF to Markdown reads a PDF entirely in the browser with pdf.js, whose worker is bundled into the app and served from the same origin — never loaded from a CDN — so the tool stays fully offline-capable and uploads nothing. A PDF stores no semantic document model, only positioned glyphs, so for each page the converter calls getTextContent() to obtain every text run with its position (the transform matrix x/y), font size (the transform’s vertical scale), width and font name. It groups runs that share a baseline into lines, orders them left-to-right, inserts spaces from x-gaps that pdf.js omitted, and reconstructs the page. Structure is then inferred heuristically: the median font size across the document is taken as the body text, and lines whose size is about 1.8×, 1.45× or 1.18× larger become #, ## or ### headings; lines beginning with a bullet (•, -, *, –) or a counter (1., a)) become Markdown list items; runs in a Bold-weight font are wrapped in **…**; and soft-wrapped lines are merged into flowing paragraphs with hyphenated words rejoined.

  • Text read with pdf.js getTextContent() — position, font size, width, font name
  • pdf.js worker bundled locally (pdf.worker.min.mjs?url) — no CDN
  • Lines rebuilt from glyph coordinates; x-gaps restore missing spaces
  • Headings inferred from font size relative to the document median
  • Lists, bold and de-hyphenated paragraph merging applied heuristically
How It Works

Output, Options and Live Preview

The conversion is fully configurable and re-runs instantly when you change a setting. You can toggle heading detection, list detection, bold detection and smart paragraph merging independently, and choose what to place between pages — a Markdown thematic break (---), an HTML page comment (<!-- page N -->), or nothing at all. The result is shown as raw Markdown you can copy or download as a .md file, alongside a rendered preview produced with the marked library inside a sandboxed iframe (sandbox=""), so scripts can never run regardless of the PDF’s content. The tool reports counts of pages, headings, list items, words and characters, and a progress bar tracks page-by-page extraction so large PDFs stay responsive. Markdown is the ideal target because it is plain text — easy to edit, diff in version control and feed to large language models.

  • Independent toggles: headings, lists, bold, smart paragraphs
  • Page-break style: --- rule, HTML comment, or none
  • Raw .md to copy/download plus a sandboxed marked-rendered preview
  • Live counts of pages, headings, lists, words and characters
  • Per-page progress for large documents
Privacy & Security

Privacy and Honest Limitations

Because all extraction and conversion run in the browser with a locally bundled worker, the PDF is never uploaded, there is no account or tracking, and the converter works offline after first load — which makes it safe for confidential documents. The honest caveat is that PDFs carry no semantic structure, so headings, lists and emphasis are inferred from font size and styling and should be reviewed. Scanned or image-only PDFs have no text layer at all: the tool detects that zero text was found and clearly states that the file looks scanned and needs OCR, which it does not perform. Multi-column pages are read in geometric order and can interleave columns, and tables are flattened to text rather than rebuilt as Markdown tables; the tool surfaces a warning when it detects a likely complex or multi-column layout.

PDF to Markdown: in-browser (AnyTool) vs typical online converters
CapabilityAnyToolTypical alternatives
ProcessingRuns in your browserUsually uploaded to a server
PrivacyPDF never leaves your deviceFile sent to a third party
Worker sourcepdf.js worker bundled locally — no CDNOften a remote CDN script
HeadingsInferred from relative font sizeOften flattened to plain text
Lists & boldBullet/numbered lists and bold detectedFrequently lost
ParagraphsSoft wraps merged, hyphenation rejoinedHard line breaks kept
Scanned PDFsDetected and flagged (needs OCR)Silent empty output
Works offlineYes (PWA)No
Cost / signupFree, no signupOften gated or ad-heavy

AnyTool extracts PDF text locally with pdf.js and a bundled worker and uploads nothing; structure is heuristically inferred, and scanned PDFs, multi-column layouts and tables are flagged or approximated with honest warnings.