Markdown to PDF: Convert .md Files Online, Free
How to convert markdown to PDF
- Open Markdown Preview and paste your markdown, or upload or drag in a .md file.
- Check the live preview. What you see is what goes into the PDF.
- Open the Export menu and choose Print / Save as PDF, or press Cmd/Ctrl+P.
- In the print dialog, set the destination to Save as PDF, pick a paper size, and click Save.
The editor, toolbar and sidebar are left out automatically, and the PDF always uses a clean light page, even if you write in dark mode. New to the syntax? The markdown cheatsheet covers tables, math and diagrams on one page.
What carries over into the PDF
Mermaid diagrams
Flowcharts, sequence diagrams and Gantt charts are drawn before printing, so they come out as sharp vector graphics, not blurry screenshots.
LaTeX math
Inline and block equations render with KaTeX, so fractions, matrices and symbols print the way they look on screen.
Highlighted code
Code blocks keep their syntax colours in over 180 languages, and a block that fits on one page is not split across two.
Tables, images and task lists
Tables, pictures, checkboxes, callouts and footnotes all print, and the PDF avoids cutting a table or picture across a page break.
Turning a GitHub README into a PDF? Check how it renders in the README preview first, then print it the same way. For writing the equations themselves, see LaTeX in markdown; for diagrams, Mermaid in markdown.
Try it with a sample document
This sample has a table, a task list, an equation, a Mermaid diagram, highlighted code and a page break. Open it in the editor, then save it as a PDF to see each one come through.
# Project report
A sample to try **Print / Save as PDF** on. Open Export, choose Print / Save as PDF, then pick "Save as PDF".
| Item | Status |
| ------- | ------ |
| Design | Done |
| Build | Doing |
- [x] Draft written
- [ ] Review pending
$$
\text{progress} = \frac{\text{done}}{\text{total}}
$$
```mermaid
flowchart LR
Write --> Preview --> PDF
```
<div style="break-after: page"></div>
## Page two
This heading starts on a new page, because of the page break above.
```js
console.log('Code keeps its highlighting in the PDF');
```
No upload, no watermark, no limit
Many online markdown to PDF converters upload your file to their server, add a watermark or cap how many free PDFs you get a day. Here the PDF is made by your own browser's print engine, so your document stays on your device and there is nothing to limit. Need a page break? Put <div style="break-after: page"></div> on its own line where the new page should start.
Questions about markdown to PDF
How do I convert a .md file to PDF online for free?
Open Markdown Preview, upload or drag in your .md file, then choose Export > Print / Save as PDF and pick "Save as PDF" in the print dialog. It is free with no limit on how many PDFs you make, and there is no sign-up.
Does the PDF keep Mermaid diagrams?
Yes. Diagrams are drawn in the preview before you print, so they land in the PDF as vector graphics. If Mermaid diagrams go missing when you export from an editor extension, open the same file here and print it instead.
Can I convert markdown with LaTeX math to PDF?
Yes. Write math between single dollar signs for inline formulas and double dollar signs for blocks. It renders with KaTeX and prints exactly as the preview shows it, with no LaTeX install needed.
Is there a watermark or a daily limit?
No. Nothing is added to your PDF and there is no cap on how many you make. The PDF is made by your own browser, so there is no server doing the work and nothing to meter.
Is my markdown file uploaded to a server?
No. The file is opened and rendered in your browser, and the PDF is made by the browser print dialog on your device. Nothing you write leaves your computer.
How do I add a page break?
Put <div style="break-after: page"></div> on its own line, with a blank line above and below it. Everything after it starts on a new page in the PDF. It is invisible in the preview.
How do I convert a GitHub README to PDF?
Choose Import from URL and paste the GitHub link to the README. Your browser fetches the raw file and renders it. Then print it to PDF the same way as any other document.
How do I remove the date and web address from the PDF?
Those come from the print dialog, not from the document. In Chrome or Edge, open More settings and untick Headers and footers before you click Save.