Skip to main content

PDF to Markdown

Convert a PDF’s selectable text to Markdown, with # headings, paragraphs and tables ready for a wiki, a README or an AI assistant. Processed locally, without OCR or uploading the document.

  • Export
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Your files are processed locally in your browser and are never sent to our servers.

Select the pages whose text should be converted to Markdown. All pages are selected by default.

Drop your file here

Recommended size: up to 100 MB

Was this tool useful?

How does this tool work?

PDF to Markdown pulls the text of a PDF into a light, readable format: headings marked with #, paragraphs separated by a blank line, tables in columns delimited by vertical bars. The result can be pasted into a wiki, a README, a note-taking app or an AI assistant, without the broken spacing of a plain copy and paste. The conversion runs in your browser and targets PDFs that contain real selectable text.

For each selected page, the PDF.js engine reads the text fragments with their position and size. Fragments at the same height are joined into lines, then nearby aligned lines are merged into paragraphs.

Character size identifies headings: a short line (120 characters at most) that is 1.65 times taller than the body text becomes a # heading, 1.35 times a ## heading and 1.15 times a ### heading. Blocks of lines aligned on several regular columns are converted into a Markdown table, with the first row as the header.

When several pages are converted, each starts with a <!-- Page n --> comment and pages are separated by a --- line. No OCR is applied: a scan without a text layer produces an error message rather than invented text.

How to use this tool

  1. Import the PDF

    Thumbnails appear with every page selected.

  2. Choose the pages to convert

    Deselect the cover, table of contents or appendices if you do not need them.

  3. Download the .md file

    The document.md file contains the structured text, ready to paste or put under version control.

Use cases

Feed a wiki or documentation

Move a procedure shared as PDF into Notion, Obsidian, GitHub or an internal wiki.

Prepare text for an AI

Give an assistant clean, structured text instead of a PDF that is hard to parse.

Rewrite or translate a document

Work on the content of a report in a text editor, with no layout to undo.

Examples

A page with a heading and a table

The large title becomes a level-1 heading and the three aligned columns form a table whose first row is the header.

Input

Page with the large title “Prices 2026”, one sentence, then a Product / Price / Quantity table

Result

# Prices 2026

Prices include VAT until 31 December.

| Product | Price | Quantity |
| --- | --- | --- |
| Pen | €1.20 | 10 |
| Notebook | €3.50 | 4 |

Tips and best practices

  • On a two-column layout, check the paragraph order: text is read line by line, from top to bottom.
  • For a scanned PDF, run the document through OCR PDF first, then convert the searchable PDF you get.
  • If you only need the tables, PDF to CSV gives you data ready for a spreadsheet.

Frequently asked questions

Why does my scanned PDF give an error?

A scan only contains images of pages, with no text to extract. Add a text layer with OCR PDF first, then run the conversion again.

Are bold, italics and links kept?

No. Only headings, paragraphs and tables are rebuilt; character formatting and links are not carried over.

How are headings detected?

By text size: a short line clearly larger than the body text becomes a #, ## or ### heading depending on the ratio (1.65, 1.35 or 1.15 times).

Are tables always recognised?

Only when they form regular, well-filled columns. A table with merged cells or a very irregular one may come out as plain lines of text.

Are the PDF’s images included?

No, the Markdown file contains text only. Recover the images with Extract images from PDF if you need them.

Is the document’s content passed to a service?

No. Reading the text and building the Markdown happen in the browser; the file does not leave your device.

Related tools

Tools similar or complementary to this one.

Works well with

Convert the text of a PDF into a structured HTML page with headings, paragraphs and tables.

PDF & documentsUse this tool

Extract the tables in a PDF into a CSV file to open in Excel, LibreOffice or Google Sheets.

PDF & documentsUse this tool

Turn the text of a PDF into structured XML (pages, headings, paragraphs, tables), ready for automated processing.

PDF & documentsUse this tool
TutorialBest practicesBeginner

How to securely redact a PDF before sharing it

Learn why covering text is not enough, how secure PDF redaction removes sensitive information and why sanitization matters before sharing.

10 September 20262 min
GuideBest practicesBeginner

How to clean and OCR a scanned PDF

Clean a scanned PDF before OCR to remove unnecessary pages and create a more useful searchable document.

6 September 20262 min