Adjacency Matrix Tool
Enter a graph as an edge list or adjacency matrix and convert between the two representations, with a rendered node-and-edge diagram.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Adjacency Matrix Tool
Click a cell to toggle an edge between two nodes.
Degree per node
Total edges
How the Adjacency Matrix Tool works
- The tool loads with a 5-node sample graph already drawn as an adjacency matrix, with a few edges pre-toggled on.
- Click any cell to add or remove an edge between the row node and column node — the diagonal is disabled since a node isn't adjacent to itself.
- Toggle "Directed graph" to switch between a symmetric matrix (undirected) and an independently-editable matrix (directed).
- Degree per node and total edge count recompute instantly below the matrix as you edit.
The method
An adjacency matrix represents a graph with N nodes as an N×N grid, where cell (i, j) is 1 if there's an edge from node i to node j, and 0 otherwise.
degree(i) = Σⱼ matrix[i][j] + Σⱼ matrix[j][i] (undirected: matrix is symmetric, so this simplifies to Σⱼ matrix[i][j])
Total edge count sums every 1 in the upper triangle for undirected graphs (each edge stored twice, once per direction, is counted once), or every 1 in the full matrix for directed graphs.
FAQ
What does "degree" mean for a node?
In undirected mode, a node's degree is its number of edge connections. In directed mode, the tool reports total degree (in-degree plus out-degree) for each node, counting an edge once at each endpoint.
What is the difference between directed and undirected mode?
Undirected mode keeps the matrix symmetric — toggling cell (i, j) also sets (j, i), and an edge counts once. Directed mode lets you set (i, j) independently of (j, i), so A→B and B→A are separate edges.
Does this tool send my graph anywhere?
No. The matrix, its edges, and the computed degrees stay in your browser tab — nothing is uploaded, and reloading the page resets to the sample graph.
How we compare
| Feature | Online Tool Store | A spreadsheet grid | A graph library script |
|---|---|---|---|
| Click-to-toggle matrix, no formulas to write | ✓ | ✗ | N/A |
| Live degree and edge count, no setup | ✓ | ✗ | ✓ |
| No install or import statements | ✓ | ✓ | ✗ |
For checking degree sequences or sketching a small graph by hand, this tool skips the spreadsheet formulas and the graph-library boilerplate — just click cells and read the numbers.