HOSTING

Share a Graphviz diagram as a link

A Graphviz diagram can be drawn in the browser from its DOT source with Viz.js, or exported as SVG and placed in a page. Either way it fits in one HTML file you upload and send as a link.

4 min read·

Graphviz turns a DOT file, such as digraph { signup -> upload -> share }, into a laid-out diagram: dependency graphs, state machines, org charts, data pipelines. Assistants and code tools often produce DOT because it is plain text. The recipient usually has no Graphviz installed, and a PNG export blurs when they zoom in.

An HTML page with the diagram as SVG stays sharp at any zoom, keeps node labels as selectable text, and opens on any device once it is hosted at a link.

Option 1: draw it in the browser with Viz.js

Viz.js is Graphviz compiled to WebAssembly. The page carries the DOT source and draws the diagram when it opens, so editing the diagram means editing text. Create graph.html with:

  • ✓<!doctype html>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1"> in the head.
  • ✓<script src="https://cdn.jsdelivr.net/npm/@viz-js/viz@3.31.0/dist/viz-global.js"></script>. This file defines a global Viz object for a plain script tag. Pinning the version keeps the layout from changing when a new release ships.
  • ✓An empty container: <div id="graph"></div>.
  • ✓A <script> block after it: const dot = `digraph { rankdir=LR; signup -> upload -> share }`; Viz.instance().then(viz => document.getElementById("graph").appendChild(viz.renderSVGElement(dot)));

Option 2: export SVG with the dot command

If Graphviz is installed, run dot -Tsvg graph.dot -o graph.svg. Open graph.svg in a text editor, copy everything from <svg to </svg>, and paste it into the body of an HTML file. The page then needs no script and no CDN, and it draws even with JavaScript turned off.

Paste the SVG into the page rather than linking it with <img src="graph.svg">. An uploaded page is hosted on its own, so a second file it points to is not there.

Upload it and send the link

Drag the .html file onto the FileShare Pro dashboard and copy the link. The diagram shows when the page opens, and viewers need no account.

If the page is blank once hosted, open the browser console. "Viz is not defined" means the script tag is missing or comes after your code; a syntax error from Viz.js names the line in the DOT source that failed. Why an AI page works in chat but breaks when hosted covers pages an assistant wrote.

Turn on comments and viewers can leave a note on the page after typing a name. When the graph changes, upload the new file over the old one and the link stays the same: updating a shared link without changing it.

Other diagram tools: Mermaid, PlantUML, draw.io, PyVis network graphs.

Frequently asked

How do I share a Graphviz diagram with someone who does not have Graphviz?

Put the DOT source in an HTML page that draws it with Viz.js, or paste the SVG from dot -Tsvg into the page. Upload the file to a host that serves HTML as a web page and send the link.

Should I use Viz.js or dot -Tsvg?

Viz.js keeps the DOT source in the page, so you edit text and re-upload. dot -Tsvg gives a page with no script or CDN, which is simpler to host but has to be re-exported after each change.

Why does my diagram not show after upload?

Usually the Viz.js script tag is missing or loads after your code, the DOT source has a syntax error, or the page points to a separate graph.svg file that was not uploaded. Check the browser console for the exact error.

Is it free?

Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free