mermaid2dot
Convert from any graph formatto mermaid2dot Convert from mermaid2dotto any other format
mermaid2dot is a small open-source JavaScript utility by GitHub user utensil that converts Mermaid flowchart diagrams into Graphviz/DOT syntax. Released under the MIT license, it targets the specific niche of taking the flowchart subset of the Mermaid text-diagram language (format:mermaid) and re-expressing it as format:dot, so the same graph can be rendered by the Graphviz toolchain or any DOT-consuming engine rather than by Mermaid's own renderer.
The converter reads a Mermaid flowchart and emits an equivalent DOT graph, mapping Mermaid's node shapes (square, rounded, circle, "odd"/asymmetric, and diamond/rhombus) onto their Graphviz counterparts, translating the various edge styles (solid, dotted, and bold/thick arrows) and edge labels, and turning Mermaid subgraphs into DOT cluster subgraphs. It also handles multi-line node text, special and non-Latin characters (the README exercises Cyrillic), and offers partial support for Mermaid's classDef/class styling statements. The project is written entirely in JavaScript and is meant to be tried out with npm install followed by npm run inspect, with generated DOT then pasted into a viz.js sandbox to check the result.
Practically, mermaid2dot is a proof-of-concept rather than a packaged tool. Its README explicitly lists a general programmatic API, a command-line interface, and an npm release as unfinished TODO items, alongside goals such as Dagre compatibility, output optimization, and broader edge-case and test coverage. It is limited to flowcharts and does not attempt Mermaid's other diagram types (sequence, class, state, Gantt, ER, and so on), and its styling and layout fidelity are approximate.
Within the graph-data and format-conversion landscape it complements the many DOT-to-Mermaid tools that flow in the opposite direction, such as tool:dot2mermaid, tool:convert2mermaid, and tool:devtoolsdaily-graphviz-mermaid, and it sits adjacent to broader diagram gateways like tool:kroki that render both notations. For users who already keep diagrams in Mermaid but want Graphviz's layout algorithms, richer attribute control, or DOT-based downstream processing via tool:graphviz, it provides a lightweight starting point; anyone needing a robust, production-grade bridge should treat it as a reference implementation to extend rather than a finished converter.
Input Formats
Output Formats
Frequently Asked Questions
What graph file formats does mermaid2dot support?
See the list on this page — it shows every format mermaid2dot can read, write and display.
How do I import a graph into mermaid2dot?
Convert your file to a format mermaid2dot can read, then open it in mermaid2dot. Use GraphInOut to get a mermaid2dot-compatible file in seconds.
How do I convert a file so mermaid2dot can open it?
Use the convert links above — upload or paste your graph, pick a format mermaid2dot accepts and download the result, right in your browser.
