Skip to main content
Back to Blog
7 min read

How to Convert Markdown to PDF (ChatGPT, Claude, Notion & More)

Markdown quietly took over the world. Every AI assistant speaks it. Note-taking apps default to it. Half the technical documentation on the internet lives in `.md` files. And yet the moment you need to *share* a markdown document — with a colleague, a client, a compliance team — you hit a wall. Email clients do not render it. Most portals will not accept `.md`. Printing looks terrible.

The fix is to convert to PDF. This guide walks through the fastest, most private way to do that — with the browser-based Markdown to PDF tool — plus everything else you should know about the format, the common pitfalls, and how it compares to Pandoc and paid services.

TL;DR — Which Approach Should You Use?

ScenarioBest approachWhy
ChatGPT / Claude / Gemini reply you want to save**[Markdown to PDF](/markdown-to-pdf)** (paste)Fastest, nothing uploaded, keeps code and tables
Notion or Obsidian export**[Markdown to PDF](/markdown-to-pdf)** (upload)Handles GFM, TOC, page numbers out of the box
GitHub README you want to share offline**[Markdown to PDF](/markdown-to-pdf)**Syntax highlighting + dark code theme
One-off document with strict style needsPandoc (CLI)More control via LaTeX templates
Hundreds of files nightlyPandoc in a CI jobScriptable, free, on your own infrastructure
You have a Microsoft Word workflow anywayPaste into Word, export PDFFine for non-technical content without code
Sensitive legal / medical / internal content**[Markdown to PDF](/markdown-to-pdf)**Never leaves your browser — no server to breach

If you already know what you need, jump to the Markdown to PDF converter. Otherwise, read on.

Why Markdown → PDF Is Suddenly Everywhere

Three years ago, "convert markdown to PDF" was a developer problem. Today it is a mainstream one. The reason is simple: large language models answer in markdown.

When ChatGPT, Claude, Gemini or a custom AI agent gives you a detailed answer — a study guide, a project plan, a code review, a contract summary — the output is almost always markdown. Headings, bullet lists, tables, code blocks. It looks great inside the chat window, but the instant you try to share it, reality bites:

  • Pasting into Gmail strips the formatting.
  • Pasting into Word produces weirdly styled text.
  • "Copy as markdown" is exactly what you do not want to send to someone who does not speak markdown.

A PDF preserves all of it — the headings, the code, the table layouts — and opens in literally anything. That is why demand for a good browser-based markdown to PDF converter has exploded.

Why Browser-Based (and Why Privacy Matters Now)

Many markdown outputs contain things you really do not want on someone else's server:

  • AI prompt leaks. You pasted a confidential memo into Claude. The reply includes chunks of it.
  • Internal strategy. A "review my business plan" prompt to ChatGPT.
  • Personal health or legal questions. The AI reply is sitting in your clipboard.
  • Proprietary code. The code block the model produced references your private APIs.

Any online converter that uploads your markdown to a server can retain it, index it, or get breached. The Markdown to PDF tool on this site does the entire conversion in your browser using marked, highlight.js and jsPDF. Nothing is uploaded. There is no account, no analytics on your content, no server log. Open DevTools and watch the network tab if you do not believe us — the only requests are for the stylesheet used by syntax highlighting.

Step-by-Step: Convert Markdown to PDF

The full flow takes about 15 seconds.

  1. Open the Markdown to PDF converter.
  2. Choose your input mode:
  3. - Paste — for a ChatGPT or Claude reply you have copied. The live preview updates as you type.
  4. - Upload — drag and drop a `.md` or `.markdown` file (from Obsidian, Notion, GitHub, etc.).
  5. Pick your layout:
  6. - Page size — A4 (most of the world) or US Letter (North America).
  7. - Orientation — Portrait for documents, Landscape for wide tables.
  8. - Font size — 10pt for dense reference docs, 12pt for general reading, 14pt for presentations.
  9. - Code theme — Light looks better on paper; Dark looks better on screen.
  10. Toggle the extras:
  11. - Syntax highlighting (on by default) — auto-detects the language in fenced code blocks.
  12. - Table of contents (off by default) — prepends a TOC built from `h1`/`h2`/`h3` headings.
  13. - Page numbers (on by default) — centred in the footer of every page.
  14. Click Convert to PDF. The file is generated locally and downloaded immediately.

That is it. If the result needs tweaking — smaller font, landscape for a wide table — change the option and convert again. There is no upload wait time, so iteration is instant.

Common Scenarios

### Exporting a ChatGPT or Claude Reply

Copy the entire reply. Paste into the Markdown to PDF tool (Paste mode). Turn the Table of contents toggle on if the reply has lots of headings, keep page numbers on, and hit convert. You now have a tidy PDF of the conversation — code blocks intact, tables laid out correctly.

For long agent transcripts where the assistant references many sources, tables are usually the bottleneck. If a table overflows the page width, switch to Landscape before converting.

### Turning a Notion Export into a PDF

Notion's built-in "Export as PDF" produces inconsistent results and skips some block types. Export as Markdown & CSV instead, then drop each `.md` file into Markdown to PDF. You get cleaner typography, a proper table of contents, and none of Notion's quirky page breaks.

### Exporting Obsidian Notes

Obsidian's default export sometimes strips frontmatter or mangles callouts. Using the markdown file directly in the browser tool skips all of that. If you use Obsidian for journaling or research, this is the fastest way to produce a shareable snapshot of a note.

### Archiving a GitHub README

Download the raw markdown from GitHub (Raw → Save As `README.md`), drop it in, and convert. The dark code theme produces a GitHub-style look that is great for technical portfolio PDFs.

Relative image paths (`./docs/diagram.png`) will not resolve — that is a browser same-origin limitation, not a tool limitation. Either replace them with absolute HTTPS URLs or inline the image as a data URI before converting.

### Technical Documentation and Runbooks

If your team writes runbooks in markdown, converting them to PDF for an audit trail is a one-click operation. Keep the markdown as the source of truth; regenerate the PDF when the doc changes. No more stale Word files.

### AI-Generated Reports

Reports from tools like Perplexity, Claude Projects and custom GPTs are markdown by default. Run them through Markdown to PDF before sharing — a report with working tables and highlighted code reads dramatically more professionally than the same text pasted into an email.

Formatting Tips for Best Results

A few small habits make your PDFs look significantly better.

Use fenced code blocks with a language hint. Writing ` ```ts ` instead of just ` ``` ` turns on accurate TypeScript highlighting. Same for `python`, `bash`, `json`, `sql` and dozens of others.

Keep table columns reasonably sized. A markdown table with long cell content will overflow on A4 Portrait. Either shorten the cells, switch to Landscape, or break the table into two.

Prefer absolute image URLs. `!diagram` or a `data:image/png;base64,...` URI will render. Relative paths like `./diagram.png` will not, because there is no file server to resolve them against.

Escape backticks inside inline code. If you want to show literal backticks, wrap them with *more* backticks: ` `` `backticks` `` ` → `` `backticks` ``.

Headings drive the table of contents. If you are turning on the TOC, use `#`, `##`, `###` consistently. The tool only extracts those three levels to keep the TOC readable.

Add page breaks explicitly (optional). If you want a specific section on a new page, insert a horizontal rule (`---`) at the start of it. The converter treats large structural elements (code blocks, tables, images) as non-breakable by default, so you rarely need manual breaks.

Common Pitfalls

The preview looks right, the PDF does not. Almost always caused by images. Check that every image URL is HTTPS and CORS-friendly.

Code blocks are cut off. Very long single lines can overflow horizontally. Use a smaller font size or introduce manual wraps. Most syntax-highlighted languages wrap naturally when there is a space to break on.

Huge documents take 10+ seconds. Expected. PDF rendering is CPU-bound, and browsers do it on the main thread. A 60-page markdown export will take 10–30 seconds depending on your machine. Close other tabs and it speeds up.

Special characters render as boxes. Usually means the markdown contains emoji or an extended Unicode glyph that the default PDF font does not ship. The browser tool uses the system font stack for PDF output, which covers 99% of real content — but obscure scripts or emoji may need a Pandoc workflow with a custom font.

The TOC feels redundant for short docs. It is. Turn it off for anything under ~5 headings.

Browser-Based vs Pandoc vs Paid Tools

Browser-based (this tool). Zero setup, zero upload, instant iteration. Perfect for day-to-day use, ad-hoc conversions, and anything sensitive. Limited to what a browser can render — no LaTeX templates, no custom fonts beyond the system stack.

Pandoc. The gold standard for command-line markdown conversion. Endlessly configurable, supports LaTeX templates, references, academic output. Requires installation, a working LaTeX toolchain for the best results, and a command-line comfort level. Overkill for a ChatGPT export; ideal for a PhD thesis.

Server-side converters (md2pdf.com, etc.). Fast and web-based, but your markdown gets uploaded. Read the privacy policy before using one for anything confidential — many explicitly reserve the right to store the content.

Paid tools (Adobe, SaaS platforms). Great if you are already inside one of those ecosystems. Expensive and usually require an account for a task the browser can do in seconds.

Word → Save as PDF. Works for text-heavy documents with no code. The formatting round-trip through Word often mangles tables and strips code highlighting, so not recommended for technical content.

For 95% of real-world use, the in-browser converter is the right answer. Reach for Pandoc only when you hit the edges.

Related Tools on This Site

Once your markdown is a PDF, the rest of the toolbox is right here:

  • Merge PDF — combine the new PDF with other documents (cover letter + report, say).
  • Compress PDF — shrink the final file for email.
  • PDF to Text — go the other direction if someone sends you a PDF of markdown.
  • Add Page Numbers — if you turned off the built-in footer and want them back.
  • Image to PDF — for converting screenshots or scans that go alongside your markdown export.

All of these run 100% in your browser, same as the Markdown to PDF converter itself.

The One-Sentence Summary

If you need to turn markdown — from an AI chat, a Notion page, an Obsidian note, a README, or anything else — into a shareable PDF without leaking it to a server, open the Markdown to PDF tool, paste or drop your file, and click convert.

Related Guides