Adjacency Matrix Calculator screenshot

Adjacency Matrix Calculator

Turn a weighted edge list into its adjacency matrix, with the edge count, the symmetry test and every node's weighted degree.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact integer weights

Adjacency Matrix Calculator

Turn a weighted edge list into its adjacency matrix, with the edge count, the symmetry test and every node's weighted degree.

How this page computes

The parser builds the node order and the edge list, then writes each edge into the matrix positions its endpoints name. An undirected edge is written to both positions; a directed edge only to the one it points at.

The symmetry test compares each entry with its transpose partner, and the degree line sums the row. Nothing is inferred: a zero entry means the list contains no such edge.

The calculation runs entirely in this browser tab; nothing is uploaded.

The page reads an edge list and writes the matrix it describes, so the four edges A-B 4, B-C 2 and A-C 5 become a 3 by 3 table whose (A, C) entry is 5 and whose (C, A) entry is the same number in the undirected reading.

Each row is a source node and each column a destination, which is the convention the matrix power and reachability formulas assume. The page also prints the edge count, whether the matrix is symmetric, and the weighted degree of every node.

How to use Adjacency Matrix Calculator

Type one edge per line as "A B 4" — two node names and an optional weight — then press Run. Blank lines and lines starting with # are ignored, so a paste from a worksheet keeps its notes.

Switch Direction to directed to keep the order of each pair. The output then reports out-degree rather than degree, and the matrix stops being symmetric wherever the two directions differ.

Why the matrix and the list are the same graph

An adjacency matrix is the edge list with its edges moved from a list of pairs into the positions those pairs name. Entry (i, j) holds the total weight of the edges from node i to node j, and a zero means no edge. Reading a row is reading everything that leaves a node.

An undirected paste keeps both (i, j) and (j, i) at the same value, because an undirected edge is traversable both ways. A pair written twice is summed, and the output says how many repeats it found, so a duplicated line is visible rather than silently folded into the original weight.

What to Expect

Best for

  • Turning a drawn or pasted graph into the matrix a formula expects
  • Seeing a graph's weighted degrees at a glance
  • Checking that a directed and an undirected reading differ where you expect

Not ideal for

  • Graphs with more than a few hundred nodes, where a printed matrix stops being readable
  • Finding the shortest path, which has its own page
  • An edge list with three or more fields per line

What this tool keeps

  • Every node name and every weight exactly as typed

What may need cleanup

  • Nothing: the matrix is the final answer

Common errors

  • A line with one token is refused with its line number
  • A duplicated pair is summed, and the edge count line says how many

Example use cases

  • Write the matrix for A-B 4, B-C 2, A-C 5
  • Compare a directed and an undirected reading of the same list
  • Read the weighted degree of each node

Sample input

A B 4, B C 2, A C 5 (one edge per line)

Sample output

a 3 by 3 symmetric matrix with A: 0 4 5, B: 4 0 2, C: 5 2 0

Who this is for

  • Students writing a graph as a matrix
  • Programmers checking a graph input

Frequently asked questions

What order are the rows and columns in?

First appearance in the edge list. A appears in the first line, so it is row 1 and column 1; the header line repeats the order so the matrix can be read without counting.

Why is the matrix symmetric?

Because an undirected edge can be traversed both ways, so entry (i, j) and entry (j, i) describe the same edge. Switch Direction to directed and the symmetry disappears wherever the two directions are not both present.

What happens if I write the same edge twice?

The weights are added, because two parallel edges carry both weights, and the edge count line names how many repeated pairs were summed. If you meant one edge, delete the duplicate line.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.