DOT to Mermaid

Paste a Graphviz DOT graph and get Mermaid flowchart source you can drop straight into a README, a wiki page or the Mermaid Live Editor. Node shapes, edge labels, dashed and bold links, cluster subgraphs, colors and rankdir are all mapped, and anything Mermaid cannot express is listed as a comment note. Runs entirely in your browser.

Try:
Mermaid source

About this tool

Graphviz DOT and Mermaid flowcharts solve the same problem with different syntax. DOT is common in build tools, dependency analyzers and older architecture docs; Mermaid is what many README files, issue trackers and knowledge bases render natively. This converter rewrites the DOT graph into Mermaid source so you can keep the structure without redrawing the diagram by hand.

Paste a graph { ... } or digraph { ... } document and the converter parses it locally in WebAssembly. It keeps node IDs, quoted labels, chained edges, graph/node/edge defaults, cluster subgraphs, rankdir, selected node shapes, edge labels, dashed/bold/bidirectional links and common color attributes. Features with no Mermaid equivalent are kept as %% notes so the output is honest rather than silently lossy.

Worked example

Input DOT:

digraph {
  rankdir=LR;
  start [label="Start", shape=circle];
  check [label="Tests pass?", shape=diamond];
  start -> check [label="build"];
  check -> ship [label="yes"];
  check -> fix [label="no", style=dashed];
}

Default output:

flowchart LR
  start(("Start"))
  check{"Tests pass?"}
  start -->|build| check
  check -->|yes| ship
  check -.->|no| fix

Turn off Keep edge labels when you only want the graph structure, or enable Wrap in a code fence to paste the result directly into Markdown:

```mermaid
flowchart LR
  start(("Start"))
  check{"Tests pass?"}
  start --> check
```

Limits and edge cases

FAQ

Can it convert every Graphviz diagram perfectly?

No. DOT can describe precise renderer layout, fonts, ports, record fields and Graphviz-only shapes that Mermaid flowcharts cannot express. This tool converts the graph structure and the common presentation hints that Mermaid supports, then lists the rest as %% comments so you can decide what to adjust manually.

Does it run Graphviz or upload my DOT source?

No. It uses a small parser compiled to WebAssembly and runs entirely in the browser. That keeps private architecture graphs local, but it also means the tool converts syntax instead of rendering DOT through Graphviz's layout engine.

What happens to labels and special characters?

Quoted DOT labels are carried into Mermaid labels and escaped for Mermaid's bracket syntax. HTML-like labels are reduced to readable text where possible; advanced table-like HTML labels are not recreated exactly because Mermaid flowcharts do not support Graphviz HTML label tables.

How should I handle a graph that uses clusters?

Leave Convert cluster_ subgraphs* enabled. Subgraphs named cluster_api or carrying a label= become Mermaid subgraphs, including nested clusters. Disable the option if the extra grouping makes the Mermaid source too noisy and you only need the nodes and edges.

Why are my node IDs different in the Mermaid output?

Mermaid IDs cannot contain every character DOT permits. Unsafe IDs are sanitized, and the original text is preserved as a label when that matters. This keeps the Mermaid parseable while still showing the names from the DOT file.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool dot-to-mermaid 'digraph {
  rankdir=LR;
  start [label="Start", shape=circle];
  check [label="Tests pass?", shape=diamond];
  start -> check [label="build"];
  check -> ship [label="yes"];
  check -> fix [label="no", style=dashed];
}'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/dot-to-mermaid/?dot=digraph%20%7B%0A%20%20rankdir%3DLR%3B%0A%20%20start%20%5Blabel%3D%22Start%22%2C%20shape%3Dcircle%5D%3B%0A%20%20check%20%5Blabel%3D%22Tests%20pass%3F%22%2C%20shape%3Ddiamond%5D%3B%0A%20%20start%20-%3E%20check%20%5Blabel%3D%22build%22%5D%3B%0A%20%20check%20-%3E%20ship%20%5Blabel%3D%22yes%22%5D%3B%0A%20%20check%20-%3E%20fix%20%5Blabel%3D%22no%22%2C%20style%3Ddashed%5D%3B%0A%7D&direction=auto&shapes=true&edge_labels=true&link_styles=true&subgraphs=true&colors=true&warnings=true&title=Release%20pipeline&fence=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.