Back to AI Tools

Diagram Generator

Create beautiful flowcharts, network diagrams, and graphs using Graphviz DOT language with live preview and easy download

DOT Code
Preview

Your diagram will appear here

Click Generate to render your diagram

Quick Examples
Complete DOT Syntax Guide

Basic Structure

digraph G { A -> B; } → Directed graph (arrows)
graph G { A -- B; } → Undirected graph (lines)

Nodes & Shapes

NodeName [label="Text"]; → Node with label
[shape=box] → box, circle, diamond, ellipse
[style=filled, fillcolor=lightblue] → Filled color

Connections

A -> B; → Directed edge (arrow)
A -- B; → Undirected edge (line)
A -> B [label="text"]; → Edge with label
[style=dashed] → dashed, dotted, bold

UML Relationships

Child -> Parent [arrowhead=empty]; → Inheritance / Extends
A -> B [arrowhead=diamond]; → Composition
A -> B [arrowhead=odiamond]; → Aggregation
A -> B [style=dashed]; → Dependency / Include
A -> B; → Association

Class Diagram

node [shape=record]; → Use record shape
Class [label="{Name|fields|methods}"]; → 3 sections
+ field\\l → + public, - private, # protected

Use Case Diagram

Actor [shape=box, label="👤 User"]; → Actor (person)
UseCase [shape=oval]; → Use case (oval)
subgraph cluster_system { } → System boundary
Actor -> UseCase; → Association
[style=dashed, label="<>"] → Include/Extend

Sequence Diagram

Object [label=":ClassName"]; → Participant object
A -> B [label="1: message()"]; → Synchronous call
[style=dashed]; → Return message (dashed)
rankdir=TB; splines=ortho; → Top-to-bottom flow

Direction & Layout

rankdir=LR; → Left to Right
rankdir=TB; → Top to Bottom
rankdir=RL; → Right to Left
rankdir=BT; → Bottom to Top

Colors

color=blue, fillcolor=lightblue → Named colors
"#FF5733" → Hex colors
"rgb(255,87,51)" → RGB colors

Grouping

subgraph cluster_0 { A; B; } → Group nodes in box
node [style=filled]; → Default node style
edge [color=gray]; → Default edge style

Quick Tip: Click any Quick Example above to see these syntax in action!

Popular Tags

Diagram Generator UML Diagram Flowchart Sequence Diagram Class Diagram Graphviz DOT Language PlantUML Alternative Free Tool Visual Design Code to Diagram