ToolSite

How to Convert a PDF to Markdown

Turn PDF documents into editable Markdown for static sites, notes, or version control. Free browser converter preserves headings, lists, and no upload.

By ToolSite5 min readguides

When PDF to Markdown Makes Sense

You have a PDF document and need its content in a format you can edit, version control, or publish on a static site. You could extract plain text, but then you lose all structure: section headings become regular sentences, numbered lists become run-on paragraphs, and bold text disappears.

Markdown is the natural target for repurposing PDF content. It is plain text with readable formatting markers. Every code editor can open it. Every static site generator (Hugo, Jekyll, Next.js with MDX, Astro) consumes it natively. And unlike a PDF, a Markdown file works with git diff, grep, and any text processing tool.

Converting PDF to Markdown preserves the document outline: headings, lists, bold and italic text, links, and basic tables. You get editable structure instead of a wall of text.

How the Conversion Works

The PDF to Markdown Converter processes a PDF in several steps:

  1. Parse the PDF: just like the text extractor, it reads every text object and its position on the page. It also reads font metadata: size, weight (bold), and style (italic).
  2. Detect structure: the converter identifies headings by looking at font properties. Text that is larger and bolder than surrounding body text, and appears near the top of a section, becomes a heading. It detects list items by looking at paragraph indentation, bullet characters, and numbered prefixes. It identifies bold and italic spans from font weight and style flags.
  3. Generate Markdown: headings become #, ##, or ###. Unordered lists become - item. Ordered lists become 1. item. Bold becomes **bold**, italic becomes *italic*. Links become [text](url). Everything else becomes regular paragraph text.

Conversion runs entirely in your browser. The PDF never leaves your device.

What Converts Well

  • Documents with a clear visual hierarchy: title, section headings, subheadings, body text. These map cleanly to H1, H2, H3.
  • Bullet and numbered lists where the PDF author used list formatting (not manually typed dashes).
  • Bold and italic spans that were applied with font styling in the source document. Manually typed **bold** inside a PDF will convert as plain asterisks, not actual bold, because the PDF stores them as literal characters.
  • Simple tables with one header row and uniform cell counts. These become Markdown pipe tables.
  • Hyperlinks created as clickable elements in the PDF. These become [text](url) Markdown links.

What Converts Poorly

  • Multi-column layouts: PDF text extraction reads left-to-right, top-to-bottom. A two-column article may interleave lines from both columns. The result alternates between column A and column B, requiring manual reordering.
  • Scanned documents: if there are no text objects in the PDF, there is nothing to convert. The output will be empty. Use OCR first, then feed the resulting text into a Markdown formatter, or use a tool like Marker that combines OCR with Markdown output.
  • Complex tables: merged cells, nested tables, and multi-line headers do not map to Markdown's simple table syntax. The converter produces a best-effort table, but you will need to restructure it manually.
  • Embedded images: the converter cannot extract images from PDFs. Markdown image references (![](path)) will not be generated. Screenshot images from the PDF separately and add them to the Markdown.
  • Page artifacts: headers, footers, and page numbers often appear in the middle of the converted text. These are detected by their repeated nature, but some will slip through.

After Conversion: What to Fix

Markdown from a PDF conversion is a starting point, not a finished document. Expect to do this cleanup:

  1. Verify heading levels: a font-size heuristic may misidentify a ## as body text or a bold paragraph as a heading. Scan the output and adjust # levels.
  2. Fix broken lists: list items that the converter missed will appear as plain paragraphs. Add the - or 1. prefix manually.
  3. Remove page artifacts: strip out page numbers, running headers, and repeated footers that leaked into the body text.
  4. Rejoin split paragraphs: PDFs sometimes split a paragraph across page breaks, inserting a blank line. In the Markdown output, this becomes two separate paragraphs. Rejoin them.
  5. Add frontmatter: if the Markdown is going into a static site generator, add YAML frontmatter with title, date, and tags.
  6. Fix tables: reconstructed Markdown tables rarely align correctly on the first pass. Check column counts and alignment.

Plain Text vs. Markdown

If you need the content and do not care about structure, use the PDF to Text Converter. It is faster and produces fewer artifacts because it does not attempt structural detection.

If structure matters and you are willing to do cleanup, the PDF to Markdown Converter saves you from manually adding ## to every heading and - to every list item.

Large Documents

For PDFs over 50 pages, consider splitting the document first with the PDF Merge/Split Tool and converting chapters individually. This makes the cleanup more manageable and reduces the risk of browser memory issues.

Command-Line Alternative

The open-source marker tool does PDF-to-Markdown with OCR support:

pip install marker-pdf
marker_single /path/to/document.pdf /path/to/output --output_format markdown

Marker handles scanned PDFs (it runs OCR internally) and produces cleaner Markdown than browser-based tools for complex layouts. However, it requires Python, GPU acceleration for speed, and several gigabytes of model downloads.

Try it yourself: open the PDF to Markdown Converter. Upload a PDF with clear section headings and lists, such as a report or documentation page. Download the Markdown output. Open it in your code editor or a Markdown previewer. Compare headings, lists, and links to the original PDF. Fix any missed structure, then paste the result into a note-taking app or static site generator.

Related Reading