Skip to main content
PDFBase

PDF to Markdown Converter

Local

Rebuild PDF text as Markdown headings, lists and paragraphs

All Tools
PDF to Markdown
Local
Tool Details
Input formatsPDF
Output formatMD
Max file size50 MB
Max files1
ProcessingLocal

Privacy First

Your files are processed entirely in your browser. Nothing is uploaded to any server.

How do I convert a PDF into a Markdown file?

Add the PDF and run the converter to download a .md file. Text fragments are grouped back into lines by their position, lines are merged into paragraphs, a line set noticeably larger than the body becomes an ATX heading, bullet and numbered lines become Markdown lists, and monospace runs become fenced code. Repeating headers and footers are dropped. Everything happens in your browser.

About the PDF to Markdown Converter

Rebuild a PDF’s text layer as structured Markdown. Text fragments are grouped back into lines by position, lines are merged into paragraphs, headings are inferred from font size, bullet and numbered lines become Markdown lists, runs set in a monospace face become fenced code blocks, hyphenated line breaks are rejoined, and headers or footers repeated on three or more pages are dropped. The inference has limits worth knowing before you rely on it: heading levels come from relative font size, so a document that sets every line at the same size comes out as plain paragraphs. Tables arrive as lines of text, not Markdown tables. Images are not carried into the output. A scanned PDF has no text layer at all and produces a warning rather than a file full of guesses. The result card reports what was found — how many headings, paragraphs and lists, how many repeated lines were removed, how many pages had no text — so you can check the output against the document.

  • Move a specification, policy or research paper into a wiki, README or docs site with its heading hierarchy already in place instead of retyping it.
  • Prepare source material for a retrieval pipeline that chunks on headings, without handing the document to a third-party parsing API first.
  • Turn a numbered procedure into a real Markdown ordered list, so the steps stay steps when the file is rendered.
  • Find out in one pass whether a PDF is a scan: the result card names every page that had no text layer instead of quietly writing an empty file.

How to use the PDF to Markdown tool

  1. 1

    Upload PDF file

    Select PDF file from your device or drag file into the upload area.

  2. 2

    Choose settings

    Choose settings such as Insert page separators before processing.

  3. 3

    Convert to MD

    Run the PDF to Markdown tool to create the MD output.

  4. 4

    Download the result

    Download the finished file. The original file stays on your device and is not uploaded.

How does it decide what is a heading?

By relative size, not by any structure stored in the file. The converter measures the font size of every line, works out the body size by weighting each size by how many characters are set in it, and treats any line at least 1.15 times that size as a heading. The distinct larger sizes are then ranked, so the biggest becomes h1, the next h2, the next h3. The consequence is worth stating plainly: a document that sets its section titles at body size, in bold alone, has nothing for this rule to find, and comes out as plain paragraphs. The result card tells you when that happened rather than leaving you to notice.

What does it do with tables, images and columns?

Tables come out as lines of text, not as Markdown tables. A PDF stores a table as ruled lines and independently positioned cells, with nothing recording that they belong to a grid, so reconstructing pipes and dashes from that would be guesswork presented as fact. Images are not carried across at all — the output is text only. Multi-column pages are the other known weak spot: two columns sit at the same heights, so their lines can interleave. Single-column documents are what this converter is good at.

What happens to repeated page headers and footers?

They are removed, and counted. A line whose text appears in the same vertical band, near the top or bottom edge, on at least three pages is running furniture rather than content — a document title, a confidentiality notice, a page number band. Left in, it interrupts the prose once per page. The converter drops those lines and reports how many it removed, so you can tell the difference between a filter that worked and a filter that ate something you wanted. Two-page documents are never filtered, because two occurrences are not a pattern.

Why does a scanned PDF produce a warning instead of a file?

Because there is no text to convert. A scan is a photograph of a page: the words are pixels, and the PDF carries no text layer at all. Rather than hand you an empty .md file and let you work out why, the converter names every page that had nothing on it. If the whole document is a scan, it says so and points at OCR, which has to happen before any text tool — this one, pdftotext, or a commercial extraction API — can find a single word.

Are my files uploaded when converting PDF to Markdown?

No. Extraction runs on your machine, which matters here more than for most tools on this site: the PDFs people convert to Markdown are usually being prepared for an internal knowledge base or a private model, and routing them through a hosted extraction service would defeat the purpose. Your file is read locally, the Markdown is built in memory, and neither is transmitted.

Convert a PDF to Markdown in code

A PDF stores glyph positions, not headings, so no converter can recover structure that was never written down. These are the practical options, weakest structure first.

Shell (poppler)

Plain text with layout preserved — the honest baseline before any structure guessing.

pdftotext -layout paper.pdf paper.txt

# Then let pandoc treat it as Markdown source
pandoc paper.txt -f markdown -t gfm -o paper.md

Python (PyMuPDF)

Font size per span is the only reliable heading signal in a typical PDF.

# pip install pymupdf
import pymupdf

doc = pymupdf.open("paper.pdf")
out = []
for page in doc:
    for block in page.get_text("dict")["blocks"]:
        for line in block.get("lines", []):
            for span in line["spans"]:
                prefix = "## " if span["size"] > 14 else ""
                out.append(prefix + span["text"])

open("paper.md", "w").write("\n".join(out))

Shell (mutool)

Part of MuPDF. Emits an HTML structure you can hand to pandoc.

# macOS: brew install mupdf-tools   Debian/Ubuntu: apt install mupdf-tools
mutool convert -F html -o paper.html paper.pdf
pandoc paper.html -f html -t gfm -o paper.md

How to do this offline, on the command line

There is no lossless PDF-to-Markdown converter, on this site or anywhere else, because a PDF does not record what a heading is. These get you closest.

pdftotext + pandoc

macOS: brew install poppler · Debian/Ubuntu: apt install poppler-utils · pandoc: brew install pandoc

pdftotext -layout paper.pdf - | pandoc -f markdown -t gfm -o paper.md

Fast and predictable, but headings stay plain paragraphs.

mutool

macOS: brew install mupdf-tools · Debian/Ubuntu: apt install mupdf-tools

mutool convert -F html -o paper.html paper.pdf

Emits font sizes and positions as HTML, which gives pandoc something to turn into heading levels.

Frequently Asked Questions

Does the output contain real Markdown headings and lists?
Yes, where the PDF gives it something to work from. Lines set at least 1.15 times the body font size become ATX headings, ranked into up to three levels; lines starting with a bullet character or a number become Markdown list items; runs set in a monospace face become fenced code blocks. Where the source has no size difference to read, the output is plain paragraphs, and the result card says so.
Why did my PDF come out as paragraphs with no headings at all?
Because heading levels are inferred from relative font size, and your document sets every line at the same size. A PDF records glyph positions, not a heading hierarchy, so there is nothing else to read. The tool reports "no headings were detected" instead of promoting arbitrary lines and hoping you do not check.
Are tables converted into Markdown tables?
No. A PDF stores a table as independently positioned cells and drawn rules, with nothing recording that they form a grid. The cells come out as lines of text in reading order. Rebuilding pipe-delimited tables from that would mean guessing at column boundaries and presenting the guess as structure.
What happens to repeated page headers and footers?
A line that appears with the same text, in the same vertical band, near the top or bottom of at least three pages is treated as running furniture and removed. The number of removed lines is reported on the result card. Documents shorter than three pages are never filtered.
Does it work on scanned PDFs?
No. A scan is an image of a page with no embedded text layer, so there is nothing to extract. Rather than write an empty file, the converter names each page that had no text and points you at OCR. Digitally created PDFs — exports from Word, Google Docs, LaTeX or a browser — work directly.
Are images from the PDF included in the Markdown?
No. The output is text only; no image files are written and no image links are inserted. Use Extract Images From PDF to pull the embedded pictures out separately, or PDF to PNG to render whole pages.

Need More Tools?

Explore our collection of 58 free PDF tools, all with privacy-first processing.

Browse All Tools