Adjacency Matrix Converter

Convert a graph between an edge list, an adjacency matrix, and an incidence matrix — directed or undirected, weighted or not. Runs entirely in your browser, no server, no sign-up.

Result

What this tool does

Convert a graph between the three ways people usually write one down — an edge list, an adjacency matrix, and an incidence matrix. Pick the Input format your data is in and the Output format you want, set Directed and Weighted to match your graph, and the conversion runs instantly. Nothing is sent to a server — it works locally, offline, and needs no sign-up.

The three representations

RepresentationWhat it looks likeGood for
Edge listOne edge per line: A B (or A B 3 when weighted)Writing a graph by hand, sparse graphs
Adjacency matrixA square n×n table; cell (i, j) is the edge from i to jAlgorithms, dense graphs, linear algebra
Incidence matrixA vertices × edges table; one column per edgeFlow problems, graph Laplacian, circuit analysis

Input format

Output format

Directed and weighted

Examples

InputFrom → ToSettingsOutput
A B / B C / A Cedges → adjacencyundirecteda symmetric 3×3 matrix for the triangle
A B / B Cedges → adjacencydirectedupper-triangular (A→B, B→C only)
A B 5 / B C 2.5edges → adjacencyweightedcells carry 5 and 2.5
a labelled matrixadjacency → edgesthe edge list it represents
A B / B Cedges → incidenceundirectedcolumns e1, e2, two 1s per column

FAQ

Is it free and private?

Yes — your graph never leaves your device, and the tool keeps working offline once the page has loaded.

How are matrices laid out?

Tab-separated, with the vertex labels in the first row and first column so you can paste the result straight into a spreadsheet.

What sign convention does the directed incidence matrix use?

The edge's tail (source) is -1 (or -weight) and its head (target) is +1 (or +weight), matching the standard oriented incidence matrix used for the graph Laplacian.

Can I round-trip?

Yes — convert edges → adjacency → edges and you get the same graph back. Isolated vertices survive because they are written as a single-token line in the edge-list output.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool adjacency-matrix-converter "A B
B C
A C"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/adjacency-matrix-converter/?input=A%20B%0AB%20C%0AA%20C&from=auto&to=adjacency&directed=true&weighted=true&power=2

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.