Make your first graph
There are three ways to start.
Example inputs
Set the graph to Undirected and 1-indexed, copy an example, paste it into Load, and apply it.
Draw a graph from an edge list
Format: edge list with counts. The first line, 4 4, gives the number of vertices and edges; each line after that is one edge.
Input
4 4
1 2
2 3
2 4
3 4Result

Convert an adjacency matrix to a graph
Format: adjacency matrix. Each row and column is a vertex; 1 means connected and 0 means not. The matrix is symmetric, so the graph is undirected.
Input
0 1 1
1 0 1
1 1 0Result

Draw a weighted tree
Format: edge list with counts, with the weight in the third column. After loading, choose Tree in Layout to show the hierarchy.
Input
4 3
1 2 5
1 3 2
3 4 7Result

Load text or a file
Paste text or open a file, check the preview, then apply it.
- Open LoadPaste text, or use Open file to pick a text file or a Graph Editor JSON file.
- Check the format and previewThe format is detected for you. If the input fits more than one format, pick one in Format. Numbering from 0 or 1 is guessed too, so check the labels in the preview.
- Choose Apply to graphYour current graph is replaced by the preview. If there are warnings, read them first. Undo brings the previous graph back.
All supported input formats
- Edge list with N M header
4 4 1 2 2 3 2 4 3 4- Edge pairs (no header)
1 2 2 3- Tree edge list (N, then N−1 edges)
4 1 2 1 3 3 4- Parent list
4 1 1 3- Weighted parent list
4 1 5 1 3 3 2- Adjacency list
1: 2 3 2: 4- Adjacency matrix
0 1 1 1 0 1 1 1 0- Graph Editor JSON (empty graph)
{ "version": 1, "nodes": [], "edges": [], "settings": {} }
Weights and direction
A third column in an edge list is read as a weight (a number or text) and turns weights on. For text-labeled input with an N M K header, K is ignored as long as all M edge rows are present. For a directed graph, choose Directed in Settings.
Place nodes and connect them
Switch between the toolbar modes as you draw.
- Add nodes with NodeClick (or tap) an empty spot on the canvas. N switches to this mode.
- Connect nodes with EdgePick the source, then the target. In a directed graph the arrow points from source to target. Click empty space or press Esc to stop.
- Arrange with SelectDrag a node to move it, or an edge to bend it. Selecting either shows the action bar at the bottom, where you can edit or delete it.
- To select several items, hold Shift and drag in Select mode. The ⌄ next to Select sets whether box selection picks everything, nodes only, or edges only.
- Ctrl (⌘ on Mac) + Shift + drag selects only nodes; Ctrl (⌘ on Mac) + Alt + drag selects only edges.
- To rename a node or change a weight, double-click it, or select it and press Enter. The right-click menu has the same options.
Change colors, labels, and graph settings
Color parts of the graph, or switch it to directed or weighted.
- Select nodes or edges and pick a color in the action bar. It works on several items at once, and C cycles through the colors.
- In Settings, choose directed or undirected, weighted or unweighted, and 0-indexed or 1-indexed. Arrow size and node labels are set there too.
- In a directed graph, select an edge and choose Reverse to flip it. Reverse all edges in Settings flips every edge.
- Return to automatic routing undoes a manual bend. You can also bend an edge with Bend left and Bend right in the right-click menu.
- Turn on Snap drags to grid to line nodes up as you move them.
Try a sample and choose a layout
Rearrange nodes without changing how they connect.
In Load, Use a sample offers trees, cycles, grids, and more. Search by name or category, and adjust values such as the node count before creating one.
Open Layout (L) to rearrange. Auto layout is a good default; Circle and Grid are handy for comparing shapes.
- Tree suits trees and forests, DAG suits directed acyclic graphs, and Bipartite suits bipartite graphs. A layout that does not fit the graph is disabled, with the reason shown.
- BFS layers puts nodes in rows by distance from a start node; Radial puts those rows on circles. Select a node first to make it the start (or the root, for Tree).
- SCC groups a directed graph by strongly connected component. Line, Concentric, and Resolve overlap are also available.
- With Offset overlapping edges on, edges that would cross a node are bent around it where possible. If something still overlaps, move a node or bend the edge by hand.
Going back
Undo returns to the previous layout. Some layouts are unavailable for large graphs.
Export your graph
Use JSON to keep editing later, and PNG to share a picture.
- JSON to keep editingIn Export, choose JSON and save the .json file. It keeps nodes, edges, labels, positions, colors, bends, and settings; open it with Load to continue.
- PNG to share a pictureIn PNG, choose the whole graph or the current view, then the background and padding. Size the image by its long edge, the current zoom, or a fixed canvas, check the preview, and save or copy it.
- Text for the connections onlyIn Export, choose Edge list, Adjacency list, or Adjacency matrix. Positions, colors, and bends are left out, and custom labels may become numbers. If a format can't express your edges or weights, use JSON or a matching edge list.
- TikZ for TeX documentsChoose TikZ (TeX), then copy the code or save a .tex file. The packages you need are listed in the comments at the top. Japanese labels need LuaLaTeX with luatexja; other Unicode labels need a suitable engine and fonts.
Autosave and backups
Your work is saved automatically in this browser's local storage. If saving fails or another tab changes the graph, export it as JSON to keep a copy. JSON does not include undo history or the current zoom.
Work with the keyboard
These work whenever you are not typing in a field.
- Select / Node / Edge mode
- VNE
- Clear selection or cancel drawing an edge
- Esc
- Delete selected elements
- DeleteBackspace
- Undo
- Ctrl+Z⌘Z
- Redo
- Ctrl+Shift+Z⌘⇧ZCtrl+Y
- Select all
- Ctrl+A⌘A
- Copy / cut / paste a selection
- Ctrl / ⌘ + C / X / V
- Edit a label or weight
- Enter
- Cycle selected colors
- C
- Nudge selected nodes
- ← ↑ → ↓
- Move selected nodes by a larger step
- Shift + ← ↑ → ↓
- Fit the whole graph to view
- Shift+1
- Reset zoom to 100%
- Ctrl+0⌘0
- Layout / Settings / shortcut list
- L,?
About copy and paste
Ctrl / ⌘ + C, X, and V copy, cut, and paste nodes and edges inside the editor. To bring in text from elsewhere, paste it into Load.
Use Ctrl on Windows and Linux, and ⌘ on Mac.
Move the view and work on a phone
Moving the view never moves your nodes.
- Drag empty canvas to pan. On a phone, use two fingers to zoom and pan.
- In Node, tap empty space to add a node; in Edge, tap two nodes in turn to connect them.
- In Select, tap a node or edge to bring up the action bar for color, label, and delete. Drag to move nodes or bend edges.
- If the graph drifts off screen, use Fit graph to view, or press Shift+1.
Troubleshooting
Common questions and fixes.
Why does my input produce a different graph?
Pick the format yourself, then check the counts on the first line, the number of columns, and whether numbering starts at 0 or 1. Look at the warnings and preview before applying. Directed or undirected is set in Settings.
Where is my graph saved?
In this browser's local storage. Nothing is sent to a server, and it doesn't sync to other browsers or devices. Clearing this site's data deletes it, so export anything important as JSON.
What should I do if autosave fails or another tab changes the graph?
Your work stays on screen. Choose Save my graph first to download a JSON copy. Then use Retry for a failed save, or compare and choose Use the other tab's graph for a conflict. Where autosave isn't available, save JSON files as you go.
How large can a graph be?
Up to 1,000 nodes and 5,000 edges. Labels and other text fields hold up to 256 characters; pasted text up to 1,000,000 characters and JSON up to 2,000,000. Large graphs can't use some layouts, and a few overlaps may remain after automatic routing.
What if copying an image or text fails?
Your browser's clipboard permissions may block it. Save the PNG, or download the text as a file instead. If the chosen format can't express the graph, switch to one that can, such as JSON.
What if I cannot see the graph?
If it's just off screen, fit it to view. If a display error appears, save a JSON copy and choose Retry. A sample that fails to load can be retried too, or you can go back to pasting.
Do I need to pay or create an account?
It's free and needs no account. The source code is on GitHub.