How to convert a PDF to Markdown

Turn a PDF into a Markdown file for notes apps, wikis, GitHub or AI chat tools, how headings and lists are detected, and what to fix in the .md file after.

Compress & convertBy the EddiesPDF teamUpdated 5 min read
Open PDF to Markdown

You've got a PDF (a manual, a paper, a policy document, your own old notes) and you want its content somewhere that speaks Markdown: Obsidian, a GitHub README, a wiki, a docs site, or a chat with an AI model. Plain text loses the headings and lists. A Word file brings formatting you'll only have to strip out again.

PDF to Markdown gives you a .md file with the structure kept as Markdown: headings, bulleted and numbered lists, bold and italic text, and simple tables. It runs in your browser, and the PDF isn't uploaded.

What Markdown is, and why it's handy for this

Markdown is plain text with a few light marks that mean something. A line starting with one # is a top-level heading, ## is the level below that, and so on down. A line starting with a hyphen and a space is a bullet point. A word wrapped in two asterisks on each side is bold. A table is rows of text with vertical bars between the cells.

The file is still readable as it is, in any text editor, which is why so many tools have settled on it. Notes apps like Obsidian store everything as Markdown. GitHub, GitLab and most static site generators render it as web pages. Notion and many wiki tools import it.

It's also a good way to hand a document to a large language model. A model reading a pasted PDF gets a stream of text with the structure guessed or lost. Given Markdown, it can see which line is a section heading, which items belong to a list and which numbers sit in which table column. That makes "summarise section 3" or "what does the table on fees say" work better, and the text is easy to cut down to the part you actually need before you paste it.

How the converter decides what's a heading

A PDF doesn't label anything as a heading. It just draws some text bigger or bolder. So the tool works it out from size:

  • First it finds the body text size: the font size used by the most characters in the pages you're converting.
  • Text at least 1.6 times that size becomes a level 1 heading (#).
  • At least 1.3 times becomes level 2 (##).
  • At least 1.12 times, if it's no more than three lines, becomes level 3 (###).
  • A short line on its own in bold, under 80 characters and not ending in punctuation like a full stop or colon, becomes level 4 (####).

Long blocks of text over 200 characters are never treated as headings, however big they are. In practice this gets most documents right, because most documents are consistent about their heading sizes. It struggles with designed PDFs where the title, pull quotes and section headings all compete for attention, since a big pull quote looks like a heading too.

Lists are recognised from their markers. Bullets such as the round dot, hyphens and arrows become hyphen bullets, and numbered items like "1." or "2)" become "1.", "2." and so on. Tables are found the same way as in our PDF to Excel tool and written as Markdown tables, with the first row used as the header row.

Paragraphs come out as one line each, with words that were hyphenated at the end of a line joined back together. Multi-column pages are read one column at a time.

Converting a PDF to Markdown on EddiesPDF

  1. Open PDF to Markdown and drop the PDF on the page. A password-protected file asks for its password.
  2. Leave "Pages" empty for the whole document, or type a range such as 2-5.
  3. Open "More options" if you want to change the defaults. "Detect headings" is on. "Separate pages with ---" is off; tick it to add a horizontal rule where each new PDF page starts.
  4. Click "Convert to Markdown". The result appears in a text box so you can read it through.
  5. Click "Continue to download" to save the .md file.

Untick "Detect headings" if the document's headings come out wrong and you'd rather add your own. Everything then stays a plain paragraph, and fixing a few headings by hand is often quicker than removing a lot of false ones.

The page separator is useful when you'll need to point back to the PDF later ("see page 12"), or when you're splitting a long document into chunks for an AI tool and want page boundaries to cut on.

What doesn't come across

Markdown is deliberately simple, and so is this conversion. Things to expect:

  • No images. Photos, diagrams and charts are left out. Get them separately with Extract images if you need them.
  • No links. Clickable links in the PDF come out as their visible text only.
  • Flat lists. Markdown can nest lists, but the converter writes every item at one level, so sub-points lose their indent.
  • Simple tables only. A Markdown table has no merged cells, so tables with cells spanning several columns or rows won't convert exactly.
  • Repeated page furniture. Headers, footers and page numbers are text, so they appear in the output once per page. Delete them in your editor.
  • Footnotes come out as ordinary paragraphs where they sat on the page.

Characters that mean something in Markdown, like asterisks, underscores and square brackets, are escaped with a backslash when they appear in the PDF's text. That's why you may see a backslash before them in the raw file. It's correct, and it disappears once the Markdown is rendered.

Scanned PDFs need OCR first

If the tool says "No text was found in this PDF", you have a scan, which is a picture of a page with no text in it. Run it through OCR PDF first, then convert the result. OCR adds an invisible text layer, and PDF to Markdown reads it like any other text. Expect to check more headings and table cells by hand on a scan, since OCR text is only as good as the image it came from. The guide to making a scanned PDF searchable explains how to get the cleanest OCR.

If you don't need any structure at all, PDF to text is the simpler choice.

Check the headings before you use it

Open the .md file in something that renders Markdown (Obsidian, VS Code's preview, or a GitHub gist) and look at the outline. If chapter titles are level 1 and sections are level 2, the rest is usually fine. If a pull quote or a big number in a chart label turned into a heading, delete the hash marks at the start of that line and move on. It takes a couple of minutes and makes the file far more useful wherever it ends up.

Try PDF to Markdown
Free, no sign-up, and it works on your phone too.
Open PDF to Markdown

Also useful: PDF to text · OCR PDF

More guides