DOT to PNG Converter

Draw a Graphviz DOT graph as a PNG on a white background, right in your browser.

or drop files here

DO

DOT Format

Graphviz DOT graph

A plain-text graph description language from the Graphviz project, also saved as .gv. A file lists nodes, edges and their attributes, and Graphviz tools such as dot lay out and render the graph.

  • plain text
  • nodes, edges and attributes
  • directed and undirected graphs
  • rendered by Graphviz
PN

PNG Format

Portable Network Graphics

A lossless raster image format developed in the mid-1990s as a patent-free replacement for GIF and standardized as ISO/IEC 15948 and a W3C Recommendation.

  • lossless compression
  • alpha transparency
  • 8-bit and 16-bit channels
  • supported by every browser

How to convert DOT to PNG

Follow these steps to convert DOT to PNG online.

    1

    Choose your DOT file, or several at once.

    2

    Wait while the converter turns each file into PNG.

    3

    Download each new PNG file. Your original file isn't changed.

Before converting DOT to PNG

  • Only the first graph in the file is drawn; later graphs are ignored.
  • The PNG is drawn on white at twice the graph's size in points, and shrunk to fit 4096 px on a side when that is larger.
  • Images and shape files named in the graph are not loaded, and nothing is fetched.
  • A file over 2 MB is refused, and a layout still running after 60 seconds is stopped.

About DOT and PNG files

What is a DOT file?

A DOT file is a plain-text graph description from the Graphviz project, also saved as .gv. It lists nodes, edges and their attributes. A graph can be directed or undirected. The file holds relationships rather than a finished picture, so Graphviz tools such as dot decide where each shape and label goes. People use it for dependency and flow diagrams and for diagrams of networks.

Programs that open DOT files

  • Windows, Mac and Linux: Graphviz lays out and renders DOT files. Its download page lists Windows installers, Linux packages and, for Mac, MacPorts and Homebrew.

Gephi opens DOT files too. Any text editor shows the source, though an editor does not draw the graph.

DOT and PNG compared

PNG, a lossless raster format from the mid-1990s, was designed to replace GIF without patent worries; it is an ISO/IEC 15948 standard and a W3C Recommendation. Every browser shows it, so a diagram sent as a PNG needs no Graphviz at the other end. The trade is that the result is pixels. The nodes and edges become pixels, so keep the DOT file for later edits.

Here, Graphviz 16.1.0 compiled to WebAssembly lays out the first graph in your file inside the browser. The picture is drawn on white at twice the graph's size in points, and it is fitted to 4096 px on each side when it would be larger. There is no quality setting. Pictures and shape files the graph names are not loaded.

Other ways to convert DOT to PNG

  • Graphviz: run dot -Tpng input.dot -o diagram.png.
  • PyGraphviz: call g = pgv.AGraph("input.dot"), then g.draw("diagram.png", format="png", prog="dot"). It draws through Graphviz's layout programs, here dot.
  • pydot: call graphs = pydot.graph_from_dot_file("input.dot"), then graphs[0].write_png("diagram.png"). The example takes the first graph with graphs[0]. Graphviz is installed separately.

Problems with DOT files

A DOT file with a syntax error is not drawn: Graphviz's own error message is shown instead, so test a small graph before adding the whole network. An empty file is refused. A graph with more than 1,000 edges is laid out with Graphviz speed limits unless it sets its own. A very large graph is drawn smaller to fit 4096 px, and its small text can become hard to read.

Frequently Asked Questions

Everything you need to know about our converter

How do I convert a DOT file to PNG?

Is this the same Graphviz as the dot command?

What happens when the file holds more than one graph?

Is the PNG background transparent?

How large is the PNG?

Why was my DOT file refused or stopped?

Are the pictures, shape files and fonts my graph names included?

What if my DOT file has an error or is empty?