ConversionConvert

Mermaid Diagram Styler

Paste any Mermaid diagram, apply a theme, change fonts, colours, lines and shadows, then download a clean SVG or high-resolution PNG. Free, in your browser.

01

Diagram

02

Style

03

Hand-drawn

04

Export

Results

Results appear here.

Unit Conversion Calculator

Convert between metric and imperial units instantly.

Image to PDF Converter

Convert images to a single PDF file with custom page settings.

PDF to Image Converter

Convert PDF pages to PNG or JPEG images with adjustable quality.

Merge PDF

Combine several PDFs into one file, in the order you choose.

Split PDF

Split a PDF into separate files by page count or ranges, or extract pages.

How to Use Mermaid Diagram Styler

How to Style a Mermaid Diagram and Export It as SVG or PNG

Mermaid turns a few lines of text into a flowchart, sequence diagram or chart. The default look is plain, though, and copying a diagram into a slide, a README or a design file usually means taking a screenshot. This Mermaid Diagram Styler draws any Mermaid diagram with the theme, font and line style you choose, then exports a clean SVG or a high-resolution PNG. Everything happens in your browser, and your diagram is never uploaded.

What Is Mermaid?

Mermaid is a text-based diagram language. Instead of dragging boxes around, you describe the diagram:

flowchart LR
    A[Order placed] --> B{In stock?}
    B -->|Yes| C[Ship]
    B -->|No| D[Back-order]

GitHub, GitLab, Notion, Obsidian and many documentation tools render Mermaid natively. Because a diagram is just text, it lives next to your code, changes in pull requests and never goes out of date in an image editor.

Supported Diagram Types

The styler reads every diagram type built into Mermaid 12.1, including:

DiagramFirst line
Flowchartflowchart LR or graph TD
Sequence diagramsequenceDiagram
Class diagramclassDiagram
State diagramstateDiagram-v2
Entity relationshiperDiagram
Gantt chartgantt
Pie chartpie
Mindmapmindmap
Git graphgitGraph
Timeline, user journey, quadrant, XY charttimeline, journey, quadrantChart, xychart-beta
C4, Sankey, block, architecture, kanbanC4Context, sankey-beta, block-beta, architecture-beta, kanban

The first line decides the type. If the tool says the type cannot be drawn, check the first line for a typo.

How to Use the Styler

Step 1: Paste Your Diagram

Paste Mermaid code into the Mermaid code box. A sample flowchart is there to start with. The preview redraws as you type. If a line has a syntax error, a message below the tool names the line and the token that was expected, and the last good drawing stays on screen until you fix it.

Step 2: Pick a Theme

ThemeLookGood for
Arctic nightCool blues on slateDashboards and technical blogs
BlueprintWhite lines on engineering blueArchitecture and system diagrams
GraphiteSoft greys with a violet highlightNote apps and dark editors
InkLight lines on near-blackDark slides and dark-mode docs
MonochromePure black on white, no fillsPrinting and academic papers
NeonBright cyan and magenta on blackDeveloper talks and social posts
PaperInk lines on warm paperDocuments and light slides
PastelSoft tinted fillsFriendly, presentation-style diagrams
SepiaWarm browns on parchmentHistorical or editorial content
CustomYour own six coloursMatching a brand

Choose Custom to reveal six colour pickers: background, text, lines and arrows, shape fill, shape border and highlight.

Charts such as pie, mindmap and git graph use eight series colours, and each theme has its own set.

Step 3: Fine-Tune the Style

  • Font: sans-serif, serif, monospace, rounded or handwritten. The tool uses fonts already on your device, so the PNG and SVG look the same as the preview.
  • Text size: 10 to 24 px. Shapes grow to fit the text.
  • Corner radius: 0 for sharp boxes, up to 24 px for pill-like shapes.
  • Line weight and border weight: thicker lines read better on slides and when printed.
  • Shape shadow: Soft adds a subtle blur. Hard offset adds a solid shadow in the border colour, for a bold, flat look.
  • Margin: empty space around the diagram.

Step 4: Export

Under the preview, Download as offers two formats:

  • SVG: a vector file that stays sharp at any size. It is self-contained, so the colours stay put when you open it in a browser, Figma, Illustrator or Inkscape, or drop it into a web page.
  • PNG: an image at the PNG size you chose in the Export settings. Use 2× for screens and slides, 3× for print and 4× for posters.

Turn on Transparent background to export without a background, so the diagram sits on any colour. Pick a theme whose lines contrast with where you will place it.

Hand-Drawn Sketch Style

Turn on Sketch, in the Hand-drawn section, to redraw the diagram as if by hand: lines wobble slightly and shapes are outlined twice like a quick pen stroke. Choose a pencil fill for coloured-pencil shading. It works with every diagram type and every theme.

  • Roughness: how loose the hand is. Low values look like a careful drawing with a ruler; high values look like a napkin sketch.
  • Pencil fill: Solid (the default), Hatching (parallel strokes), Cross-hatching or Zigzag. Small marks such as arrowheads, dots and label tags always stay solid so they remain readable.
  • Paper texture: a faint paper grain behind the drawing. It is part of the SVG and the PNG, and is left out when the background is transparent.
  • Font: with Automatic, Sketch uses a handwritten font. Pick any other font to override it.

The drawing is stable: the same diagram always comes out the same, so the preview doesn't jitter as you edit. Sketch files are larger than clean ones (often 10 to 20 times), because every pencil stroke is a separate line in the SVG.

Keeping Colours You Set in the Code

Mermaid's own styling still works. Colours set in the diagram stay exactly as written, whatever the theme:

flowchart LR
    A --> B
    style B fill:#d0a215,stroke:#8a6614
    classDef warn fill:#ef7a5a
    A:::warn

Text on a filled shape switches between light and dark automatically for contrast.

Differences from Mermaid's Own Renderer

The styler uses Pele, a lightweight Mermaid renderer built for Obsidian, rather than Mermaid's own library. It reads the same syntax, but lays diagrams out with its own engine. Expect tidier spacing and slightly different node positions, not a pixel-for-pixel copy.

A few Mermaid features behave differently:

  • Mermaid themes (%%{init: {'theme': 'forest'}}%%) don't apply. Use the theme picker instead.
  • HTML inside labels isn't drawn. Use plain text, **bold** and *italic*.
  • Links and images in the diagram are switched off, so a diagram can't load anything from the internet.

Privacy

The diagram is drawn by code running in your browser. Nothing is sent to a server, logged or stored.

Frequently Asked Questions

Is the SVG editable?

Yes. Shapes, lines and text are real SVG elements, so you can open the file in any vector editor and change it.

Why does my PNG look blurry in a slide?

The slide is probably scaling it up. Export at 3× or 4×, or use the SVG, which never blurs.

Can I use the images commercially?

Yes. The diagram is your own work, and the tool adds no watermark.

My diagram is very large. Will it work?

Diagrams up to 50,000 characters are drawn. Very large PNG sizes are capped so the browser can still create the file. If you hit the limit, split the diagram or choose a smaller PNG size.