Mermaid to PDF
Convert a Mermaid diagram to PDF, with the Markdown around it
Write your flowchart, sequence diagram or Gantt chart in a mermaid code fence and MDPress draws it. The diagram appears in the live preview and lands in the PDF as vector artwork, so lines stay sharp at any zoom. No install, no command line, and no account for your first four PDFs a day.
Open the converterFrom mermaid fence to PDF in three steps
- 01
Paste your Markdown
Paste the document into the editor, or upload a .md file. Keep each diagram in a fenced code block that opens with three backticks and the word mermaid, the same way GitHub expects it.
- 02
Check the diagram in the preview
The preview draws every diagram as you type. If the syntax has a mistake, the block shows as plain code instead, so you can spot the broken line and fix it before you export.
- 03
Pick a style and download
Choose Clean, Editorial or Technical, then A4, A5 or US Letter. Press the PDF button and the file downloads with your diagrams embedded and the surrounding text selectable.
A Markdown file with a Mermaid flowchart
This short process note holds one flowchart between two pieces of ordinary Markdown.
# Release process Every change follows the same path from review to production. ```mermaid flowchart LR A[Open pull request] --> B[Code review] B --> C[Run tests] C --> D[Deploy to staging] D --> E[Release] ``` ## Notes - Reviews need one approval. - Tests run on every push. - Staging uses the same settings as production.
Release process
Every change follows the same path from review to production.
flowchart LR
A[Open pull request] --> B[Code review]
B --> C[Run tests]
C --> D[Deploy to staging]
D --> E[Release]
Notes
- Reviews need one approval.
- Tests run on every push.
- Staging uses the same settings as production.
Why convert Mermaid diagrams here
Vector, not a screenshot
Each diagram goes into the PDF as vector artwork instead of a bitmap. Zoom in on a dense flowchart or print it on paper and the lines and labels stay crisp.
Diagram and document together
Most Mermaid tools export one picture. Here the diagram sits inside the whole document, next to your headings, tables and highlighted code, so a spec or design note ships as one file.
Diagrams kept in one piece
A diagram is scaled down to fit the page width, and the layout avoids splitting it across two pages. If one lands awkwardly, put a \newpage line above it to start a fresh page.
Tips for clean diagrams
- Keep node labels short and plain. Long labels make a wide diagram, and a wide diagram is scaled down to fit the page, which shrinks its text.
- Large diagrams read better on A4 or US Letter than on A5. For a long chain of steps, try a top to bottom flowchart so it uses the height of the page.
- If a fence shows as code in the preview, the Mermaid syntax has an error. The PDF will show the same code block, so fix it before you download.
Mermaid to PDF questions
- How do I convert a Mermaid diagram to PDF?
- Put the diagram in a fenced code block marked mermaid, paste it into MDPress and press the PDF button. The diagram can be the whole document or one part of a longer Markdown file. Both work the same way.
- Which Mermaid diagram types are supported?
- MDPress runs the standard Mermaid library in your browser, so flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts and the other built-in types are drawn. If a diagram shows in the preview, it will be in the PDF.
- Is it free, and is my diagram stored?
- You get four free PDFs every 24 hours without an account and five with a free account. Your text is sent to the server once to build the PDF and is not kept. The draft itself stays in your browser.
Turn your Mermaid Markdown into a PDF
Paste a document with a mermaid fence and watch the diagram appear in the preview.