Adjacency Matrix Maker

Paste an edge list, an adjacency list or a matrix to get the adjacency matrix, adjacency list, edge list and a drawing of the graph, for directed, undirected, weighted or unweighted graphs, with degrees, density and components.

An adjacency matrix maker turns a list of edges into an N×N grid where row i, column j holds 1 (or the edge weight) when node i connects to node j, and 0 otherwise.

Use the Adjacency Matrix Maker

Graph Input

Enter edges on the left and click Build.

Matrix convention and privacy

Rows are sources and columns are targets. Parallel edges are summed, and an undirected self-loop appears once on the diagonal but contributes twice to unweighted degree. Weighted totals are labeled strength. Inputs are processed only in this browser and are not uploaded.

References: NetworkX adjacency matrix documentation and Wolfram AdjacencyMatrix documentation.

One Graph, Three Representations

RepresentationUndirected A–B, A–C, B–C, C–DBest for
Edge listA B · A C · B C · C DInput files, sparse graphs, weighted edges
Adjacency listA: B C · B: A C · C: A B D · D: CTraversal (BFS, DFS) in code; memory O(n + m)
Adjacency matrix[[0,1,1,0],[1,0,1,0],[1,1,0,1],[0,0,1,0]]Edge lookup in O(1), matrix powers (Aᵏ counts walks of length k); memory O(n²)

Conversions: edge list → matrix sets cell (u, v) for every edge (and (v, u) when undirected). Matrix → edge list reads every non-zero cell, using only the upper triangle for an undirected graph. Row sums are out-degrees and column sums are in-degrees. Density = m ÷ (n(n−1)/2) for undirected and m ÷ (n(n−1)) for directed simple graphs.

Copied!

Quick answer

An adjacency matrix maker turns a list of edges into an N×N grid where row i, column j holds 1 (or the edge weight) when node i connects to node j, and 0 otherwise. Undirected graphs give a symmetric matrix; directed graphs fill only source-to-target cells. Reading the non-zero cells back gives the edge list.

Example: Undirected edges A–B, A–C, B–C and C–D give rows A [0 1 1 0], B [1 0 1 0], C [1 1 0 1] and D [0 0 1 0], so the degrees are 2, 2, 3 and 1, there are 4 edges and the density is 4 ÷ 6 = 0.667.

Paste edges, an adjacency list or a matrix, then copy the result as CSV, LaTeX, Python or an edge list.

Summary

Enter edges as “A B” (or “A B 2.5” when weighted), an adjacency list as “A: B C”, or paste a square matrix, and this tool builds the N×N adjacency matrix, the adjacency list, the edge list and a circular drawing of the graph. An optional node list keeps isolated vertices. It reports degree or strength, edge count, density, connected components and self-loops, and exports CSV, LaTeX, Python or an edge list. Everything runs in your browser.

How it works

  1. Choose the input format: edge list, adjacency list or matrix.
  2. Choose directed or undirected and enable weights when needed.
  3. Optionally enter every node to retain isolated vertices (or to name the rows of a pasted matrix).
  4. Click Build to generate the adjacency matrix, adjacency list, edge list and graph drawing.
  5. Read the N×N grid: each cell is an edge count or summed edge weight; rows are sources and columns are targets.
  6. Check degree or strength, edge count, density and connected components, then export CSV, LaTeX, Python or the edge list.

Use cases

  • Verify hand-built adjacency matrices for graph theory homework.
  • Convert an adjacency matrix from a textbook back to an edge list or a picture of the graph.
  • Turn an adjacency list from code into a matrix for linear-algebra work.
  • Check degree sequences, density and connectivity before applying graph theorems.
  • Prepare data for NetworkX, MATLAB or other graph libraries.

Frequently Asked Questions

Last updated: 2026-10-09 · Reviewed by Nham Vu