Graphviz Online Editor

Render DOT graphs live and export SVG.

The Graphviz Editor renders DOT language graphs in the browser. Write DOT source, choose a layout engine, and see the graph update in the preview, then download it as an SVG file.

What is Graphviz and the DOT language?

Graphviz is a graph visualisation toolkit. A graph is described in the DOT language: the keyword graph (undirected) or digraph (directed), then a body of node and edge statements. An undirected edge is written with two dashes, a directed edge with an arrow. Attributes in square brackets set labels, shapes, colours and styles, and graph-level settings such as rankdir choose the direction. You state what is connected and a layout engine decides where everything goes. The dot engine draws layered hierarchies, neato and fdp use force-directed layouts, circo arranges nodes in circles, twopi makes radial layouts, and sfdp is a scalable force-directed engine for large graphs. This editor uses Graphviz compiled to WebAssembly through the @viz-js/viz library, so the layout code is the real Graphviz engine rather than a lookalike.

How to use Graphviz Online Editor

  1. Write the DOT source Edit the DOT source box. It starts with a small left-to-right example with a client, api, cache and db.
  2. Pick a layout engine Open Layout engine and choose an engine such as dot, neato, circo, fdp, twopi, osage, patchwork or sfdp. The list comes from the library and also includes the nop engines, which do no real layout and exist for testing.
  3. Check the preview The Preview updates about 0.4 seconds after you stop typing or change the engine.
  4. Read errors and warnings A DOT error box shows the Graphviz message when the source cannot be laid out. A warning box lists non-fatal messages.
  5. Download Click Download SVG to save graph.svg.

Frequently asked questions

Is my graph uploaded?

No. Graphviz runs as WebAssembly in the page and the source is not sent to a server.

Which layout engines are available?

The menu shows the list exported by the @viz-js/viz library: circo, dot, fdp, neato, nop, nop1, nop2, osage, patchwork, sfdp and twopi. Until the library finishes loading, the menu shows a default list of dot, neato, circo, fdp, twopi, osage, patchwork and sfdp.

Can I export a PNG?

No. This tool only offers Download SVG. The SVG can be opened in a browser or vector editor and exported to PNG from there.

What is the difference between graph and digraph?

graph is undirected and uses --. digraph is directed and uses ->.

Why does the layout change when I add a node?

The engine recomputes positions for the whole graph, so adding one node can move others.

Is the SVG sanitised?

Yes. The SVG is passed through DOMPurify with its SVG profile before it is displayed or downloaded.