Markdown has quietly taken over technical writing. README files, GitHub issues, Notion pages, internal wikis, documentation, blog drafts, meeting notes — all Markdown. It's a great format to write in: minimal syntax, fast, and editor-agnostic.
But it's not always a great format to share. A raw .md file is plain text. Open it in Notepad and the headings are just lines starting with hash marks. The links are full URLs. The tables are rows of pipes and dashes. None of the structure that makes Markdown lovely is visible until something renders it.
This is where Markdown-to-PDF conversion shines: it takes your .md source and produces a beautiful, styled document with proper headings, formatted tables, syntax-highlighted code blocks, and clickable links. Let's walk through six ways to do it.
When to convert Markdown to PDF
- Sharing a README with non-developers. Stakeholders want to see the project overview without opening GitHub or learning Markdown syntax.
- Polishing project specs. A formatted PDF spec is much more pleasant to review than scrolling Markdown source.
- Printing tutorials and how-to guides. Workshops, training, or just personal reference — printable PDFs are still useful.
- Submitting Markdown as homework. Many courses accept Markdown but want it as PDF for grading.
- Archiving meeting notes. Static, immutable, easy to attach to emails.
- Blog drafts for client review. Editors and clients prefer reviewing a polished PDF over a Markdown file.
Method 1: Online Markdown to PDF converter
Quickest path: drop your .md file into FixMyPDF's Markdown to PDF tool. It supports standard Markdown plus GitHub Flavored Markdown (GFM) extensions: tables, task lists, strikethrough, autolinks, and fenced code blocks with syntax highlighting for 100+ languages.
Best for: any single-file conversion. Free, no install, no watermark.
Method 2: Pandoc (the universal converter)
Pandoc is the Swiss Army knife of document conversion. To convert Markdown to PDF:
pandoc document.md -o document.pdf \
--pdf-engine=xelatex \
--highlight-style=tango \
-V geometry:margin=2cm \
-V mainfont="Times New Roman"
Pandoc gives you total control over fonts, page sizes, headers, footers, table of contents, bibliography, and citations. The trade-off is setup: you need a LaTeX engine installed (XeLaTeX or LuaLaTeX).
Best for: academic papers, books, anything that benefits from professional typography.
Method 3: VS Code + "Markdown PDF" extension
Install the "Markdown PDF" extension by yzane. Open your .md file, right-click, and choose "Markdown PDF: Export (pdf)". The output uses VS Code's Markdown preview styling, which is clean and professional out of the box.
Best for: daily workflow when you already have VS Code open. Fully offline.
Method 4: Typora or Obsidian export
If you write Markdown in a dedicated app like Typora, Obsidian, or iA Writer, they all have built-in PDF export with beautiful default styling. Typora is particularly nice — the WYSIWYG editing means you can see exactly what the PDF will look like as you write.
Best for: writers who do most of their work in a Markdown editor anyway.
Method 5: GitHub-style render in browser
A surprisingly good approach for GitHub-flavored Markdown:
- Push your
.mdto a GitHub repo (or use a Gist) - Open it in the browser
- Hit
Ctrl+P/Cmd+P - Choose "Save as PDF"
GitHub's rendered Markdown looks great printed. Tables, code blocks, and task lists all come through beautifully. Free, requires no install, just uses what's already in your browser.
Method 6: Programmatic with marked + Puppeteer (JS)
For automated workflows, render Markdown to HTML with marked, then print to PDF with Puppeteer:
const fs = require('fs');
const { marked } = require('marked');
const puppeteer = require('puppeteer');
const md = fs.readFileSync('post.md', 'utf8');
const html = `<!DOCTYPE html><html><head>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/github-markdown-css@5/github-markdown-light.css">
<style>body{padding:30px;max-width:800px;margin:auto;}</style>
</head><body class="markdown-body">${marked(md)}</body></html>`;
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'networkidle0' });
await page.pdf({ path: 'post.pdf', format: 'A4' });
await browser.close();
})();
This produces a GitHub-styled PDF that you can integrate into any Node.js workflow.
Need a quick Markdown to PDF conversion?
Drop your .md file into our free converter — rendered headings, tables, code blocks, and images. No watermark.
Quality comparison
| Method | Setup | Visual quality | Customization |
|---|---|---|---|
| Online (FixMyPDF) | None | ★★★★ | Themes |
| Pandoc | 15 min | ★★★★★ | Total |
| VS Code extension | 1 min | ★★★★ | Themes |
| Typora / Obsidian | Already installed | ★★★★ | Themes |
| GitHub + print | None | ★★★★ | Limited |
| marked + Puppeteer | 30 min | ★★★★ | Total |
Tips for great Markdown PDFs
- Add a title and date at the top. Markdown files often lack a header; add one explicitly so the PDF doesn't start in media res.
- Use a single H1. Multiple H1s confuse the PDF outline and screen readers.
- Reference images by absolute URL. Relative paths break in online converters. Use a public image host or an absolute path.
- Test code blocks. Specify the language hint (
```python, not just```) so syntax highlighting works. - Add page breaks where logical. Insert
<div style="page-break-before:always"></div>before major sections. - Preview before sharing. A 30-second preview catches 90% of formatting issues.
FAQ
Will my code blocks be syntax-highlighted?
Yes, if you tag them with the language. ```python ... ``` gives you Python highlighting. Plain ``` renders as monospaced text with no colors.
How are images handled?
Online converters fetch absolute-URL images and embed them. Relative paths (./img/foo.png) require the images to be uploaded alongside the .md file or referenced via an absolute URL.
Does it support LaTeX math?
Most modern converters (including FixMyPDF's) render $...$ and $$...$$ as proper math via MathJax or KaTeX. Pandoc with the right pdf-engine is the gold standard for math-heavy documents.
What about footnotes?
Footnotes [^1] with definitions at the bottom of the file are supported in GFM and rendered correctly. They appear as proper PDF footnotes.
Can I include a table of contents?
Pandoc has --toc for an auto-generated table of contents. Online tools usually don't. If you need a ToC, generate the Markdown manually using a tool like markdown-toc and include it at the top of your file.
Wrap-up
Markdown is a fantastic writing format, but for sharing — especially with non-technical readers — PDF is the lingua franca. Pick the conversion method that matches your situation: online tool for quick one-offs, Pandoc for publication-grade output, VS Code for daily workflow.
The next time someone asks for "the README as a document I can read on the train", you'll know exactly what to do.