Network density calculator: density, degree and clustering
Paste who is tied to whom and get density, degree, components and clustering, with every formula shown.
Network density calculator
Density 0.381: 8 of 21 possible ties.Undirected density = 2L / n(n − 1) = 16 / (7 × 6) = 0.381. Most ties: Esi, Kofi and Yaw (3 each).
- 7nodes (people)
- 8ties (edges)
- 2.286mean degree, 2L / n
- 1component (all connected)
- 2triangles (three people all tied)
- 0.667mean local clustering
| Person | Degree | Clustering |
|---|---|---|
| Esi | 3 | 0.333 |
| Kofi | 3 | 0.333 |
| Yaw | 3 | 0.333 |
| Abena | 2 | 1 |
| Ama | 2 | 1 |
| Kwesi | 2 | 1 |
| Adjoa | 1 | n/a |
Clustering treats ties as mutual: a person’s clustering is the share of pairs of their contacts who are tied to each other (n/a with fewer than two contacts). Transitivity for the whole network: 0.5.
Explained by Tomasz Wierzba · Last update: Oct. 14, 2026
The calculator takes a list of ties (pairs of people connected by whatever relation you recorded) and returns density, mean degree, components, triangles and two kinds of clustering, plus each person's degree and local clustering. Everything it reports can be checked with a pencil on a small network, which is what this page does.
Entering ties
Write one tie per line, two names to a line. The parser accepts several separators:
- a space:
Ama Kofi - a comma, semicolon or tab:
Ama, Kofi - an arrow:
Ama -> KofiorAma → Kofi - a hyphen with a space on each side:
Ama - Kofi
When a space is the only separator, a name cannot contain one, so write Ama Serwaa, Kofi for a two-word name. A hyphen without spaces belongs to the name: Ama-Kofi is one person. Names are case sensitive.
A name alone on a line adds someone with no ties. Record these isolates: leaving them out shrinks n and inflates density. Anything after # is a comment.
A note under the results reports three kinds of line. A repeated tie is counted once; in mutual mode Kofi Ama repeats Ama Kofi, while in one-way mode they are two separate ties. A self-tie such as Ama Ama is dropped, although the name still joins the network. A line with three or more names is skipped. In one-way (directed) mode the first name sends the tie and the second receives it.
Density
Density is the share of possible ties that are present. With n people there are n(n - 1)/2 pairs, so for L mutual ties
density = L / (n(n - 1)/2) = 2L / (n(n - 1))
When ties run one way, Ama to Kofi and Kofi to Ama are different ties, the number of possible ties doubles to n(n - 1), and
density = L / (n(n - 1))
Both versions are defined in Wasserman and Faust's Social Network Analysis: Methods and Applications (Cambridge University Press, 1994). Density runs from 0 (nobody tied) to 1 (everyone tied to everyone).
Degree, components and triangles
A person's degree is their number of ties. Each tie has two ends, so degrees add up to 2L and the mean degree is 2L/n. In directed mode the table splits degree into in (ties received) and out (ties sent), and the figure shown is L/n, which is both the mean in-degree and the mean out-degree. The red dots on the drawing mark whoever has the most ties, counting both directions.
A component is a set of people who can all reach one another through chains of ties; one component means everyone is connected, however indirectly. Direction is ignored here. A triangle is three people all tied to one another.
Clustering and transitivity
Local clustering asks how many of a person's contacts are tied to each other. Someone with k contacts has k(k - 1)/2 pairs of contacts, and clustering is the share of those pairs that are tied. Watts and Strogatz averaged this measure over whole networks in their 1998 Nature paper, which our explainer on small-world networks works through. With fewer than two contacts there is no pair to check, so the tool shows n/a, and its mean local clustering averages over people with two or more contacts only.
Transitivity is the whole-network version: of all connected triples (a person plus two of their contacts), what share close into triangles? Each triangle closes three triples, one at each corner, so
transitivity = 3 × triangles / connected triples
For clustering, triangles and transitivity the tool reads every tie as mutual, even in directed mode. Ties both ways between two people count once.
Worked example: the default network
The example in the box is a hypothetical village where a tie means two people helped each other at harvest:
Ama Kofi
Ama Esi
Kofi Esi
Kofi Yaw
Yaw Abena
Abena Kwesi
Kwesi Yaw
Esi Adjoa
Eight lines, eight ties, and seven different names: n = 7 people and L = 8 ties. Nobody here is an isolate; to add one, put a name alone on its own line.
Density: possible ties = 7 × 6 / 2 = 21, and density = 2 × 8 / (7 × 6) = 16/42 = 0.381.
Mean degree: 2 × 8 / 7 = 16/7 = 2.286.
Each person, in the order the tool lists them:
| Person | Contacts | Degree | Pairs of contacts | Pairs tied | Clustering |
|---|---|---|---|---|---|
| Esi | Ama, Kofi, Adjoa | 3 | 3 | 1 (Ama-Kofi) | 1/3 = 0.333 |
| Kofi | Ama, Esi, Yaw | 3 | 3 | 1 (Ama-Esi) | 1/3 = 0.333 |
| Yaw | Kofi, Abena, Kwesi | 3 | 3 | 1 (Abena-Kwesi) | 1/3 = 0.333 |
| Abena | Yaw, Kwesi | 2 | 1 | 1 | 1 |
| Ama | Kofi, Esi | 2 | 1 | 1 | 1 |
| Kwesi | Abena, Yaw | 2 | 1 | 1 | 1 |
| Adjoa | Esi | 1 | 0 | 0 | n/a |
The degrees add to 16 = 2L, as they must. The Kofi to Yaw tie joins the two halves, so there is 1 component. There are 2 triangles: Ama, Kofi and Esi, and Yaw, Abena and Kwesi. Each appears once per corner in the "pairs tied" column, which is why it sums to 6.
Mean local clustering, over the six people with two or more contacts: (3 × 1/3 + 3 × 1) / 6 = 4/6 = 0.667.
Transitivity: the "pairs of contacts" column sums to 12 connected triples, so 3 × 2 / 12 = 0.5.
The two figures differ because the mean gives each person one vote, and three people with a single closed pair pull it up, while transitivity counts triples, and Esi, Kofi and Yaw hold nine of the twelve.
Switch to one-way ties and the same eight lines become eight arcs out of 42 possible, so density halves to 8/42 = 0.19 and mean in-degree is 8/7 = 1.143. Ama sends two ties and receives none; Adjoa receives one. Triangles and clustering do not change.
Why density falls as networks grow
Put the formulas together. Mean degree is 2L/n, so
density = mean degree / (n - 1)
(in directed mode, mean out-degree / (n - 1)). Nobody's day gets longer as a village grows, so mean degree stays within human limits while n - 1 keeps rising. Hold the example's mean degree fixed and enlarge the village:
| People n | Ties L | Mean degree | Possible ties | Density |
|---|---|---|---|---|
| 7 | 8 | 2.286 | 21 | 0.381 |
| 28 | 32 | 2.286 | 378 | 0.085 |
| 140 | 160 | 2.286 | 9,730 | 0.016 |
| 1,400 | 1,600 | 2.286 | 979,300 | 0.0016 |
People in the largest network have exactly as many contacts on average as in the smallest, yet density is more than 200 times lower. So compare densities only between networks of similar size, and report n and mean degree with them. Bruce Mayhew and Roger Levinger made population size the baseline for density of interaction in a 1976 American Journal of Sociology paper, and Anderson, Butts and Carley (Social Networks, 1999) examined how size and density together shape other whole-network measures. Borgatti, Everett and Johnson's Analyzing Social Networks (SAGE, 2013) covers all these measures.
For a hand-worked network that adds closeness and betweenness, see density and centrality, worked by hand. The statistics starter explains the permutation tests used to compare networks.
Questions
Why is Adjoa's clustering n/a and not 0?
With one contact the ratio is 0/0. The tool leaves such people out of the mean; some programs count them as 0, which would give 4/7 = 0.571 here. Check the convention before comparing software.
Can I enter how strong a tie is?
No. Ties are present or absent. A line like Ama Kofi 3 has three items and is skipped. To work with strength, pick a threshold (say, helped on at least two days) and enter only the ties that pass it.
Should I choose mutual or one-way ties?
Follow the question you asked. "Who did you help?" produces one-way answers that two people may not agree on. Mutual mode merges Ama to Kofi and Kofi to Ama into one tie, hiding whether help was returned.
How large a network can it take?
The measures work at any size. The circle drawing appears for up to 60 people, and the table shows the 40 with the most ties.
Other Models
- Cousin calculator
Second cousin once removed? Count the generations to a shared ancestor and get the name, the relatedness and the expected shared DNA.
- Kinship terms chart
One family tree, six classic systems: see which relatives Eskimo, Hawaiian, Sudanese, Iroquois, Crow and Omaha terms merge or split.
- Pedigree collapse calculator
How many ancestor slots you have at each generation, when they outnumber everyone alive, and how much of your tree is repeats.
- Section system simulator
Moieties, four sections and eight subsections: pick a person and see where their spouse, children and parents fall.