mermaid.design is an online Mermaid diagram editor. Write Mermaid syntax on the left and watch the diagram render live on the right. Everything runs entirely in your browser — your diagrams never leave your device.
Your first diagram
- Open mermaid.design — the editor loads with an example flowchart.
- Edit the Mermaid code in the left pane, for example:
flowchart TD
A[Start] --> B{Ready?}
B -- Yes --> C[Ship it]
B -- No --> D[Keep coding]
- The preview re-renders automatically as you type (with a short debounce). If the syntax is invalid, the last good diagram stays visible behind an error banner, and the code editor marks the failing line.
The workbench
The editor is a three-pane workbench:
- Code editor (left) — a lightweight CodeMirror editor with Mermaid syntax highlighting, autocompletion and starter snippets (diagram types, node shapes, labeled edges, subgraph blocks…), inline error markers, two-way canvas selection sync, and a format/copy/clear toolbar. You can collapse it to a slim icon strip, or drag the divider to resize it.
- Preview (center) — the interactive diagram canvas. Drag empty space to pan, Ctrl/⌘ + scroll or pinch to zoom, and use the fit-to-view button. Canvas background options are dots / white / checker.
- Theme panel (right) — one-click presets, fine-grained theme variables, and seed-color theme generation. See below.
On narrow screens the workbench becomes a single pane with a bottom Code / Preview / Theme tab bar.
Visual editing and code tools
- Edit on the canvas — double-click a node or label to edit its text, then press Enter or click outside to commit. Click an entity to open its editing popover; depending on the diagram type, you can change shapes, colors, connections, and other properties, or delete it.
- Two-way selection sync — selecting a canvas entity highlights and reveals its Mermaid source. Moving the CodeMirror caret onto an entity’s source selects it on the canvas.
- Shared undo history — Ctrl/⌘+Z and Ctrl/⌘+Shift+Z undo and redo both code and canvas changes in one history.
- Search & replace — press Ctrl/⌘+F to find and Ctrl/⌘+H to open replace. Use next/previous, match case, regular expressions, whole-word matching, replace, or replace all; replacements update the canvas too.
Render modes
Use the segmented control in the navbar to switch how your diagram is rendered:
- Official — the standard Mermaid SVG output, exactly as the Mermaid engine renders it.
- ASCII — your diagram converted to text art you can paste into code comments, docs, or terminals. See ASCII Rendering.
The mode is part of the URL, so you can bookmark or share a link to a specific mode.
Themes
Every diagram is rendered with the base theme plus a set of over 70 editable theme variables:
- Presets — the 11 built-in Mermaid themes (Default, Neutral, Forest, Dark, Base, and more) plus designer presets, each with a mini preview.
- Theme Variables — tune individual colors, borders, and fonts by group, with search.
- Generate — derive a complete theme from a single seed color, light or dark.
Your work is saved automatically
The editor persists your code, theme, and layout to your browser’s local storage. Close the tab and come back later — your diagram is still there. Nothing is uploaded to a server.
Next steps
- Templates — start from a ready-made diagram
- ASCII Rendering — turn diagrams into text
- Export & Share — download SVG, PNG, JPG, or WebP