Markdown to PDF
Free Markdown to PDF converter: write on the left, preview live on the right. Tables, code, Mermaid diagrams and share links. No sign-up, no uploads.
- Live preview
- Mermaid diagrams
- One-click PDF
- Share by link
🔒 Everything is calculated in your browser. No data is sent to any server.
When to use it
- Technical docs and READMEs: Turn Markdown files into a neatly formatted PDF for clients or managers.
- Resumes and portfolios: Write your resume in Markdown, get headings and tables laid out automatically, and save it as a PDF to send.
- Meeting notes: Paste Markdown exported or copied from Notion or Obsidian and convert it to PDF.
- Flowcharts and architecture diagrams: Write flowcharts and sequence diagrams in Mermaid and export them to PDF with your text.
How to use
- Type or paste Markdown on the left, or click "Open file" to load a .md file. The formatted result appears on the right as you type. Click "Sample" if you want to see the syntax first.
- Code blocks that start with ```mermaid turn into flowcharts, sequence diagrams and other charts right in the preview.
- Click "Export PDF" to open the print dialog, set "Destination" to "Save as PDF" and save.
Worked example
When the first line is "# **Project** Report 2026/10", the print dialog suggests the file name "Project Report 2026 10": the bold markers are dropped and the slash, which file names can't contain, becomes a space. Without an H1 the first heading is used, so a document with only "## Meeting notes: Q3?" becomes "Meeting notes Q3". With no headings at all, the name is "Document".
Paste <img src="logo.png" onerror="alert(1)">, [click me](javascript:alert(1)) and a <script> block. After sanitizing, only <img src="logo.png"> and a plain "click me" with no link target remain, the <script> is removed entirely, and nothing runs in the preview.
The task list "- [x] Done" and "- [ ] To do" becomes two read-only checkboxes, one checked and one empty, and they print as shown. A line "First line" followed directly by "Second line" stays in the same paragraph (as on GitHub); leave a blank line to start a new paragraph.
Reading the results
- The preview on the right is exactly what goes into the PDF. Only the preview is printed; the site header, buttons and editor are left out. In dark mode the preview is dark, but the PDF always uses dark text on white.
- A red error box where a diagram should be means that Mermaid block has a syntax error. The box shows the message and the source, and the diagram redraws once you fix it. The error box also prints, so check before exporting.
- Turn on "Background graphics" in the print dialog to keep the light shading on table headers and code blocks. "Headers and footers" adds the URL, date and page numbers to every page.
- Tables, code, diagrams and quotes avoid splitting across pages, and headings aren't left alone at the bottom of a page. A single block taller than a page will still be split.
How it works
- Conversion: marked turns Markdown into HTML following the GitHub Flavored Markdown (GFM) spec, including tables, strikethrough, task lists and autolinks. A single line break does not start a new line.
- Safety: the generated HTML always goes through DOMPurify before it reaches the page. It strips <script>, event attributes such as onerror, javascript: links and iframes, and this tool also blocks <style> and form controls, so pasted content can't run code or break the page.
- Diagrams: the Mermaid library (fairly large) is downloaded only when the content has a ```mermaid block, and only once. Diagrams are drawn as SVG with the strict security level, and finished diagrams are cached so typing doesn't redraw the others.
- Export: "Export PDF" uses the browser's print function. The print stylesheet (@media print) keeps only the preview, uses A4 paper with 16 mm top and bottom and 15 mm side margins, and always uses light colors. The suggested file name comes from the document's first H1.
Limitations
- The PDF is produced by the browser's print function, so page breaks, fonts and headers and footers vary by browser. On phones, choose to save as PDF from the print or share menu; the steps depend on the system.
- Math (LaTeX), footnotes, automatic tables of contents and syntax highlighting are not supported, and headings don't become PDF bookmarks.
- Images must be referenced by URL (https://…); local file paths on your computer can't be read, and web images need a connection to appear.
- If the Mermaid library hasn't been loaded before, regular Markdown still converts offline, but diagrams show a loading error.
FAQ
How do I add a page break?
Put <div style="break-after: page"></div> on its own line, with a blank line before and after. Everything after it starts on a new page.
How do I remove the URL and date at the top of the PDF?
Those are the browser's headers and footers. In the print dialog, open "More settings" and uncheck "Headers and footers".
Which Mermaid diagrams are supported?
Any diagram Mermaid supports works, including flowcharts, sequence diagrams, Gantt charts, class diagrams, state diagrams and pie charts. If the syntax is wrong, the preview shows the error message and the source in that spot.
Is my document uploaded?
No. Converting, previewing and creating the PDF all happen in your browser. Nothing is sent to a server or stored, and it disappears when you close the page.
Can I share a Markdown document with someone?
Yes. Press “Copy share link”: the text is compressed into the part of the URL after #, so the other person sees the same preview and can save it as a PDF. That part is never sent to the server. If a long document makes the link too long, you’ll be asked to share the file instead.
Can I convert Notion or Obsidian notes to PDF?
Yes. Export as Markdown from Notion, or copy the content in Obsidian, then paste it in. Obsidian-specific syntax such as [[wikilinks]] isn’t supported and appears as plain text.
Can I put images in the PDF?
Yes, using an online image URL such as . The browser can’t read local image paths on your computer, so upload the image to an image host or website first.
What is Markdown?
A plain-text way of marking up formatting with simple symbols: # for a heading, ** around text for bold, - at the start of a line for a list. It’s faster to write than Word and easy to version with Git.
💬 Can't find an answer? Report a problem with this tool or send a suggestion
References
- GitHub Flavored Markdown Spec — GitHub
- Printing — MDN Web Docs
- Usage — Mermaid