Generate

Graphviz DOT Viewer & Diagram Generator

Write Graphviz DOT source and see the graph render live — pick a layout engine, then export SVG, PNG or PDF.

Runs entirely in your browser — nothing you paste is uploaded or stored.

DOT reference ↗
Preview100%

Load an example, or write DOT source to see the graph rendered here.

What is graphviz diagram generator?

Graphviz is the long-standing open-source graph visualisation toolkit, and DOT is its plain-text language: you list nodes and the edges between them, and a layout engine works out where everything goes so the lines don't tangle. It is the engine behind a lot of the dependency graphs, call graphs, state machines and architecture sketches that developer tools generate, and DOT is often what those tools print when asked for a graph. This page compiles the real Graphviz layout engines to WebAssembly and runs them in your browser, so you can paste DOT from a tool's output or write it by hand and see the result update as you type, without installing Graphviz or sending the graph anywhere. You can switch between the eight layout engines — dot for hierarchies and flowcharts, neato and fdp for undirected networks, circo for cycles, twopi for radial trees, sfdp for very large graphs — and export the finished graph as SVG for documentation, PNG for a slide or chat, or PDF through your browser's print dialog.

When to use it

  • Visualising the output of a tool that prints DOT, such as a package manager's dependency graph, a build system's target graph, or a Terraform plan, without installing Graphviz locally.
  • Drawing a state machine or request flow for a design document, and keeping the .dot file in version control so the diagram can be diffed and regenerated.
  • Comparing layout engines on the same graph to find the one that makes a tangled network readable.
  • Producing a clean SVG of a class or module dependency diagram to embed in a README or wiki.
  • Debugging a DOT file that fails in a pipeline, using the exact Graphviz error message and line number.

How to use this tool

  1. Click Load example, or pick one of the starter graphs from the Examples list, or paste your own DOT source into the left pane.
  2. Watch the graph render in the right pane as you type; a syntax mistake shows Graphviz's own error message instead of a blank preview.
  3. Choose a layout engine from the Layout list — dot suits directed hierarchies, neato or fdp suit undirected networks, circo suits cycles.
  4. Scroll to zoom and drag to pan the preview, double-click to reset, or open the fullscreen viewer for a large graph.
  5. Download the graph as SVG, PNG or PDF, copy the SVG markup or image, or download the .dot source to commit alongside your code.
  6. Copy a share link to send someone the exact source and layout, so the page opens with it already loaded.

Example

A left-to-right build flowchart with a decision loop, the first built-in example.

Input

digraph G {
  rankdir=LR;
  node [shape=box, style="rounded,filled", fillcolor="#e0f2fe"];
  Start [shape=circle, fillcolor="#bbf7d0"];
  Check [shape=diamond, fillcolor="#fef9c3"];
  Start -> Check -> Build;
  Check -> Fix [label="fails"];
  Fix -> Check;
  Build -> Deploy;
}

Output

A left-to-right flowchart with a green start circle, a yellow Check diamond that leads to Build and Deploy, and a labelled "fails" loop through Fix back to Check — rendered as an SVG you can zoom, pan and export.

Change the layout to neato or circo to see the same graph positioned a different way; the DOT source does not change.

What renders the graph

Graphs are laid out by Graphviz, compiled to WebAssembly by the open-source viz.js project. The result is a plain SVG, which is what makes zoom, pan and the SVG, PNG and PDF exports possible without any extra rendering step. The engine is loaded only when this tool opens, so no other page on the site pays for it.

A note on colours in the export

Graphviz draws on a transparent background with black lines by default. The preview shows the graph on a white sheet in both light and dark mode so those defaults stay readable, and the PNG export is transparent. If you want a coloured background baked in, add bgcolor="white" to the graph’s attributes.

Frequently asked questions

What is DOT, and do I need to learn it?

DOT is Graphviz's small text language for graphs. The core of it is `a -> b` for a directed edge, `a -- b` for an undirected one, and square brackets for attributes such as `[label="yes", color=red]`. You rarely need more than that to be productive. The quickest way to learn it is to load one of the examples and edit it, and the "DOT reference" link next to the layout list opens the full official language documentation.

Which layout engine should I pick?

Start with dot, the default, for anything with a direction — flowcharts, dependency trees, state machines. For undirected networks where there is no natural top or bottom, neato (spring model) or fdp (force-directed) usually read better. circo lays nodes out on circles and suits cyclic structures, twopi draws a radial tree from a root node, sfdp is built for graphs with thousands of nodes, osage packs clusters, and patchwork draws a treemap. If one layout looks tangled, try another — the source stays the same.

Why do I get an error instead of a graph?

Graphviz's own parser reports the problem and this page shows its message directly, usually naming the line and the token it did not expect. The most common causes are a missing closing brace, an unquoted node name containing a space or hyphen (wrap it in double quotes), a missing semicolon or comma between attributes, and using `->` in an undirected `graph` or `--` in a `digraph`.

Is this the real Graphviz, or an approximation?

It is the real Graphviz layout code, compiled to WebAssembly by the open-source viz.js project, so the node positions match what the command-line `dot` produces for the same input and version. Because the engine is a WebAssembly module of several hundred kilobytes, it is downloaded only when you open this page and never on any other page of the site.

Can I use images or HTML-like labels?

HTML-like labels, record shapes and clusters all work because they are part of the layout engine. Node images that point at external files do not, since the page cannot read files from your disk or fetch other websites on your behalf. Use shapes, colours and labels instead, or embed the exported SVG in a tool that can add images afterwards.

How large a graph can I render?

The source is limited to 50,000 characters. Layout runs in your browser tab with no progress bar, so an unbounded input could freeze the page. That is room for several hundred nodes with dot; for much larger graphs, choose the sfdp engine, which is designed for them, or split the graph into subgraphs.

Does my graph leave my browser?

No. Parsing, layout and export all happen locally in WebAssembly and JavaScript. Nothing you type is uploaded or logged, and a share link carries your graph inside the URL itself rather than storing it on a server.

Find these tools useful? A coffee helps keep them free and ad-light.

Buy me a coffee