Skip to main content
FD

Flowchart Diagram Generator

Write simple NodeId[Label] --> OtherId[Label] lines and get an instant flowchart, rendered as downloadable SVG.

Did you like the tool? Thanks!
Share:

One edge per line: NodeId[Label] --> OtherId[Label]. Brackets are optional once a node already has a label. First line may set the direction with graph TD, graph LR, flowchart TD or flowchart LR (defaults to TD). This is a hand-rolled flowchart-only subset, not the full Mermaid language — see the article below for what is and isn't supported.

Your diagram preview will appear here.

How to Use Flowchart Diagram Generator

Type a small flowchart definition using a Mermaid-inspired syntax — one edge per line, like A[Start] --> B[End] — and this tool automatically lays out the nodes into a top-down or left-right diagram and renders it as inline SVG. Download the result as an SVG file with one click. This is a lightweight, hand-rolled flowchart-only renderer, not a full Mermaid implementation.

About Flowchart Diagram Generator

Flowcharts are one of the fastest ways to communicate a process — a signup flow, an approval chain, a decision tree — without reaching for a full diagramming application. Mermaid, the popular open-source diagram-as-text project, made a particular syntax for this widely familiar: `A[Start] --> B[End]` reads almost like plain English and is easy to write directly in a text file or a Markdown document. This tool borrows that same familiar, readable syntax for its input format, but it is important to be upfront about what it actually is: a small, hand-rolled, flowchart-only renderer built without any external diagramming library, not the full Mermaid.js package. In keeping with this site's approach of avoiding new JavaScript dependencies for every widget — the same reasoning that led the YAML and HTML formatters to hand-roll their own lightweight parsers rather than bundle a full library — this tool implements just enough of Mermaid's flowchart syntax to be genuinely useful for simple diagrams, entirely in vanilla JavaScript. The input format supports one edge definition per line: `NodeId[Label text] --> OtherId[Label text]`. The bracketed label is optional on any line where a node has already been given a label earlier in the document — so once you've written `A[Start]` on one line, a later line can simply reference `A --> B` without repeating the label, exactly like referring back to something you've already introduced. An optional first line sets the overall direction: `graph TD` or `flowchart TD` for a top-down layout (each level of the flow becomes a horizontal row, read top to bottom), or `graph LR`/`flowchart LR` for a left-to-right layout (each level becomes a vertical column, read left to right). If you omit the direction line entirely, the tool defaults to top-down, matching Mermaid's own default behavior. Laying a graph out automatically requires deciding how far "down the flow" each node sits, and this tool does that with a longest-path level assignment: every node starts at level 0, and then the tool repeatedly walks every edge, pushing a node's level to one more than its source node's level whenever that would increase it. This is a simple, well-understood technique (essentially a longest-path relaxation over a directed graph) that naturally handles diagrams where a node has multiple incoming paths of different lengths — it always ends up placed after the longest chain that leads to it, which produces a visually sensible layered diagram rather than overlapping nodes. Because a genuine cycle (A leading back to B leading back to A) would make "the longest path" undefined and could loop forever, the relaxation pass is capped at a small, fixed number of iterations tied to the number of nodes in the graph; if levels are still changing once that cap is reached, the tool concludes the graph contains a cycle and shows a friendly "Cycles are not supported" message instead of hanging the page. Once every node has a level, nodes are grouped into rows (top-down) or columns (left-right), spaced out based on how many nodes share that level and how wide each node's label makes its box. The diagram itself is built as real, inline SVG — rounded-rectangle boxes for nodes, straight connecting lines with arrowhead markers for edges — assembled directly as SVG markup strings in JavaScript. Every label is HTML/XML-escaped before being inserted into that markup, the same self-XSS-prevention discipline used across every text-rendering tool on this site, so a node label containing angle brackets or ampersands can never be interpreted as markup. The finished diagram can be downloaded as a standalone `.svg` file, which — unlike a raster PNG — stays crisp at any zoom level and can be dropped straight into a slide deck, a wiki page, or further edited in a vector graphics tool.

Details & Tips

Supported syntax: an optional first line of `graph TD`, `graph LR`, `flowchart TD` or `flowchart LR` (graph and flowchart are treated as synonyms; direction defaults to TD if this line is omitted), followed by one edge per line in the form `NodeId[Label text] --> OtherId[Label text]`. Node IDs may contain letters, digits and underscores. The bracketed label is optional wherever a node has already received a label on an earlier line — for example, after `A[Start] --> B[Process]`, a later line `B --> C[End]` is valid and simply connects the already-labeled B to a newly labeled C. A node that never receives a bracketed label anywhere in the document is displayed using its ID as its label. How layout works: every node's "level" is the length of the longest path from any root node (a node with no incoming edges) to it, computed by repeatedly relaxing every edge (pushing a target node's level to source-level + 1 whenever that is larger) until nothing changes. In TD mode, level 0 sits in the top row and each subsequent level is a row below it, with nodes in the same level spread out horizontally. In LR mode, level 0 sits in the left column and each subsequent level is a column to its right, with nodes in the same level spread out vertically. Cycle handling: because a cycle has no well-defined "longest path" (you could always find a longer one by going around the loop again), the level-relaxation pass is capped at a small number of iterations tied to the node count. If levels are still changing when that cap is reached, the tool reports "Cycles are not supported" instead of attempting to render an undefined layout or freezing the page. Rendering: the diagram is built as inline SVG — each node is a rounded rectangle with centered, HTML/XML-escaped label text, and each edge is a straight line trimmed to meet the border of its source and target boxes (rather than crossing into them), ending in a triangular arrowhead defined once as a reusable SVG `<marker>`. "Download as SVG" saves the exact rendered markup as a standalone `.svg` file, which stays sharp at any zoom level, unlike a raster image. What is explicitly NOT supported (this is a deliberately scoped-down subset, not a Mermaid replacement): subgraphs (nested groupings of nodes), styling classes or custom colors per node/edge, any diagram type other than flowcharts (no sequence diagrams, class diagrams, Gantt charts, or pie charts), the `TB`, `BT` and `RL` direction keywords (only `TD` and `LR` are recognised), edge labels (text describing what an edge means), and dotted/thick line edge styles. Cyclic graphs are rejected with an error message rather than rendered as an approximation. For anything beyond simple, acyclic flowcharts, a full diagramming tool or the actual Mermaid.js library (used in an environment that can load it, such as a documentation site with build tooling) is the right choice — this widget's goal is a fast, dependency-free way to sketch a straightforward flow directly in the browser.

Frequently Asked Questions

Is this the full Mermaid.js library?
No. This is a small, hand-rolled flowchart-only renderer built without any external diagramming package, supporting a useful subset of Mermaid's flowchart syntax — not the complete Mermaid language or its other diagram types.
What syntax do I write?
One edge per line: NodeId[Label text] --> OtherId[Label text]. The bracketed label is optional on any line where the node already has a label from an earlier line. An optional first line sets the direction with graph TD, graph LR, flowchart TD or flowchart LR.
What happens if I write a cycle, like A --> B and then B --> A?
The tool detects that levels never stabilize within a safety cap on iterations and shows a "Cycles are not supported" message instead of trying to render an undefined layout or hanging the page.
Does it support graph TB, BT or RL?
No, only TD (top-down) and LR (left-right) are recognised. TB, BT and RL will be reported as an unsupported direction.
Can I style individual nodes with different colors or classes?
No, this scoped-down tool renders every node with the same style (a rounded box with a consistent fill and border). Per-node styling classes are not supported.
Does it support subgraphs or sequence/class/Gantt/pie diagrams?
No, this tool only supports flat flowchart-style node and edge diagrams. Subgraphs and every other Mermaid diagram type are out of scope.
How is the layout decided automatically?
Each node is assigned a level equal to the length of the longest path leading to it from a root node (a node with no incoming edges), computed with a simple iterative relaxation pass. Nodes at the same level are laid out in the same row (top-down) or column (left-right).
Can I download the diagram?
Yes, use "Download as SVG" to save the exact rendered diagram as a standalone SVG file, which stays crisp at any zoom level and can be edited further in a vector graphics tool.
Is my diagram text uploaded anywhere?
No, parsing, layout and rendering all happen locally in your browser using JavaScript. Nothing is sent to a server.
Are node labels safe if they contain special characters like < or &?
Yes, every label is HTML/XML-escaped before being inserted into the SVG markup, so special characters display as literal text rather than being interpreted as markup.
Why did my diagram definition fail to parse?
The most common cause is a line that doesn't match the NodeId[Label] --> OtherId[Label] pattern exactly — check for a missing "-->", unmatched brackets, or a node ID containing characters other than letters, digits and underscores. The error message includes the line number to help you find it.

Part of These Collections

Also Available As

flowchart generator, mermaid diagram alternative, text to diagram, flowchart maker online, diagram generator, svg flowchart, node edge diagram tool

Found a Problem?

Let us know if something with Flowchart Diagram Generator isn't working as expected.

Thanks — we'll take a look.