Mermaid diagrams from syntax to an embeddable SVG file
When to use it
Architecture diagrams in a design doc, call sequences in an API spec and schedules in a handover note can all be written as Mermaid text, so changing one word never means redrawing. The catch is that the official renderer loads from a CDN, which fails on intranets, air-gapped machines and pages that forbid external links.

This page ships its own renderer for the common subsets of flowchart, sequence, class, ER and gantt diagrams and emits native SVG. It suits developers and product people who write docs, design reviews and API references, and anyone who needs a diagram inside Word, a wiki page or a slide.
Steps
- Pick Flowchart in the template selector. A four-node example with start, decision, process and end appears; press Render to see it immediately.
- Replace the labels with your own, for example change "submit form" to "check session". Switch the direction at the top from TD to LR if the diagram gets too tall, then render again.
- Press Syntax check. If you wrote
->instead of-->, the diagnostics panel reports "line N: unsupported edge syntax". Fix it and render. - Use zoom in, zoom out and fit width in the preview, and switch between light, dark and print themes to check contrast for export.
- Press Export SVG for vector output to embed in a document. If the target cannot handle CSS classes inside SVG, export PNG instead and get a 2x raster.

Parameters
The first line picks the diagram type: flowchart or graph for flowcharts, sequenceDiagram, classDiagram, erDiagram and gantt for the rest. A wrong type stops the whole block from parsing.

Flowcharts take one of four directions: TD top down, LR left right, BT bottom up and RL right left. Node shapes come from brackets: [] is a rectangular step, () a rounded start or end, {} a decision diamond, (()) a connector circle and [()] a database.
Edges are written --> for a solid arrow, --- for a plain line, -.-> for dashed and ==> for thick. Add a label with trailing |text| or by writing -- text -->. Reversed arrows such as <- are rejected by the diagnostics.
Sequence participants are declared as participant A as User, messages as A->>B: text and dashed replies as A-->>B: text. Blocks start with loop, alt or opt and close with end. Notes use Note over A,B: text.
Class members live inside class User { +id: int }. Relations use <|-- for inheritance, <|.. for realisation, --> for association and ..> for dependency; the arrow head decides which side owns the relationship.
Gantt tasks are written Task name :tag, 2026-12-01, 5d, with milestone for checkpoints and section for grouping. dateFormat defaults to YYYY-MM-DD.
Reading the output
After a successful render the metrics show node count, edge count, canvas width and height and elapsed time. Canvas size follows node count and label length, and the export uses that size at 1x for SVG and 2x for PNG.
Every diagnostic line carries a number and a reason: unrecognised type line, unsupported arrow, unclosed bracket, a subgraph missing end, a gantt date in the wrong format. Checking parses without rendering, so you can fix problems before the canvas goes blank.
Themes only swap a class on the SVG root; the geometry is unchanged. Light suits white documents, dark suits presentations, and print forces a white background with heavier strokes for monochrome printing.
Exported SVG carries semantic class names for nodes, edges and labels, so colours can be overridden with CSS. PNG is drawn through canvas at 2x, which is convenient for chat tools and slide decks that dislike vector assets.
FAQ
It says the edge syntax is unsupported. Why? A single ->, => or <- is not valid Mermaid. Use -->, -.-> or ==>, or swap the two nodes for a reverse relationship.
Long labels get cut off. What can I do? The renderer does not wrap text and truncates beyond 24 characters. Shorten the wording or split it into two connected nodes, which also reads better once exported as an image.
Nodes inside a subgraph escaped to the outside. Check that subgraph and end are paired and that the node declarations sit inside the block. Edges crossing subgraphs belong outside the block.
Colours disappear when the SVG is placed in Word. Word's support for embedded CSS in SVG is inconsistent. Switch to the print theme and export PNG, or inline the colours as attributes.
Does it support mindmap or journey? No. Five diagram families are covered; anything else is reported as unsupported rather than drawn incorrectly.
When a diagram is going into a document, export at the size the document needs rather than scaling a huge canvas down. A flowchart with ten nodes reads well at 800 pixels wide; one with thirty nodes needs either a wider canvas or a split. Keep the source snippet in a fenced block next to the image so the next edit is a text change rather than a redraw. Reviewers also appreciate a one-line caption explaining what the diagram is meant to prove, because a diagram without a claim tends to be skipped. Finally, check the print theme before exporting for a black-and-white report; the colour differences that separate a decision from a step can disappear when saturation is removed.
A useful rule of thumb: if a node needs more than about eight words, it is really two nodes with a connecting edge, and splitting it improves both the drawing and the sentence you write in the caption. Diagrams that fit on one screen also survive being pasted into a slide without anyone zooming in. Keep the exported file name tied to the diagram's purpose, so a folder of SVG files still makes sense six months later.
New in 1.1.0: state diagrams, pie charts, mind maps and wrapping
Alongside the existing flowchart, sequence, class, ER and gantt renderers, three more diagram types are supported: stateDiagram-v2 for transitions, where [*] becomes a start or end node; pie for proportions, taking the first eight slices and reporting the rest in diagnostics; and mindmap, which rebuilds the hierarchy from indentation and gives the root a wider rounded frame. All three render locally and each has a runnable example in the template menu.
Node labels are no longer truncated to an ellipsis. Text wraps by word first and by character when there are no spaces, up to three lines, and the node grows in width to the longest line and in height with the line count, so wrapped nodes do not overlap.
PNG export gained a scale selector: 1x for previews, 3x or 4x for print and slides. The confirmation reports the exact pixel size so you can verify the target resolution before using the file.
1.2.0: timeline, wrap limit and transparent PNG
A timeline renderer joins the existing diagram types. One line per period, such as 2026 Q1 : commercial release : audit pipeline, becomes a horizontal axis with event cards, and a title line sets the heading. It suits roadmaps, version history and the chronology of an incident review.
Label wrapping is now configurable at two, three, four or six lines instead of a fixed three. Long nodes in a narrow column used to be truncated; raising the limit lets a full Chinese sentence show and the node height grows to match. Changing the selector re-renders immediately.
PNG export gained a transparent background option. With transparency selected the background rectangle is removed from the SVG before rasterising, so the PNG carries an alpha channel and drops cleanly onto a dark slide or a page background. The white mode still fills with the current theme colour. Ctrl or Cmd plus Enter renders without reaching for the button.
1.3.0: accessible semantics, Markdown export and a larger timeline
Exported SVG now carries title, desc and aria-label with the diagram type, node count, edge count and provenance. A screen reader announces a flowchart with six nodes and five edges, and a document embed gives search engines a semantic description instead of an unexplained vector object.
Markdown export wraps the current source in a fenced code block as diagram.md, ready to paste into a README, an issue or a knowledge base. With native rendering on GitHub and GitLab, readers see a diagram rather than code.
A timeline period used to show at most four events, with the rest silently dropped. The limit is now six, and the card height grows with the event count while the axis and dots stay put. More than six is still truncated on purpose, which keeps one column from dominating the layout.