How it works

How a relationship calculator works out cousins and ‘removed’

Second cousin or first cousin once removed? How family tree software turns parent links into the right word, step by step, and why in-laws need extra rules.

Plugpixels Editorial TeamTechnology 5 min read
A tablet on a sofa cushion showing a branching tree of small cards, two of them highlighted and joined by a path up and down

A relationship calculator answers the question every family gathering eventually asks: how exactly are we related? Family tree software such as the Family Tree app does it in a fraction of a second, but the logic underneath is the same one genealogists have used on paper for centuries.

This piece explains how that logic works: how a tree is stored as data, how the program finds the common ancestor, how it turns two numbers into words like ‘second cousin once removed’, and why in-laws and half-relations need extra rules.

How does family tree software store a family?

To a computer, a family tree is a graph: a set of people (nodes) joined by links (edges). Each person has links to their parents and to their partners. Children are not stored separately; they are simply the people who point to someone as a parent.

This structure is what lets software walk around the family. From any person it can step up to the parents, sideways to a partner, or down to the children. Standard formats such as GEDCOM store families the same way, with people and couples joined by identifiers, which is why trees can be moved between programs.

How does it find the common ancestor?

To relate two people, the program first collects all the ancestors of person A, with the number of generations to each one. It then walks up from person B, generation by generation, until it meets someone in A’s list. That person, the closest shared ancestor, is the key to everything.

In practice there are usually two: a couple who are both ancestors of A and B. Software treats them together, which is why siblings come out as ‘brother’ rather than ‘half-brother’. If only one parent is shared, the result becomes a half-relation.

The maths is fixed, so quality depends on the data and the design.

How do two numbers become a word?

Once the common ancestor is found, the calculator has two counts: how many generations A is below that ancestor, and how many B is below. Call them a and b. The rules are simple:

  • If one count is zero, it is a direct line: parent, grandparent, great-grandparent, and so on upwards, or child and grandchild downwards.
  • If both counts are 1, they are siblings.
  • If one count is 1 and the other is larger, it is an aunt, uncle, niece or nephew, with ‘great’ added for each extra generation.
  • If both counts are 2 or more, they are cousins. The smaller count minus one gives the cousin degree: 2 means first cousins, 3 means second cousins.
  • The difference between the two counts gives the ‘removed’: one generation apart is once removed, two is twice removed.

What does ‘once removed’ actually mean?

Take your mother’s first cousin. Your mother and her cousin share grandparents. You are three generations below those grandparents; the cousin is two. The smaller count is 2, so you are first cousins, and the difference is 1, so you are first cousins once removed. Their children are three generations below the same couple, just like you, which makes them your second cousins.

Doing this by hand for a large family is slow and easy to get wrong. A relationship calculator runs the same steps automatically. Family Tree, a family tree app built by the European product lab Galveo, follows the parent and partner links between two people and puts the result into words, from niece to third cousin twice removed. Every card in the tree already shows the relation from your point of view.

Why do in-laws need extra rules?

Pure blood relations come from the common-ancestor maths. In-laws do not: your sister-in-law shares no ancestor with you. Software handles them by allowing one partner step at the start or end of the path. Your partner’s sister becomes sister-in-law; your brother’s wife becomes sister-in-law too.

Beyond the familiar cases, many languages have no single word, so good software describes the path instead. Family Tree names partners’ relatives with labels such as ‘Husband’s grandmother’, which is clearer than an invented term. It also gives each family that married in its own colour, so your partner’s side and your mother’s side are easy to tell apart on screen and in a printable family tree.

What makes a good relationship calculator in an app?

The maths is fixed, so quality depends on the data and the design. Look for a genealogy app that lets several relatives fill in their own branches, because a missing parent link breaks every relation that runs through it. In a shared family tree, each relative joins with a tree of their own linked to yours, so gaps fill faster.

Family Tree is a free family tree app that runs on iPhone, iPad and Mac, and as a family tree app Android phones and tablets can use, it shows the same family on each device. To create a family tree there, you type your name and birthday and add parents, partner and children from your card. Its Numbers view includes the relationship calculator for any two people, and as a family tree maker and family history app it adds an ancestor fan, family dates and a family map.

Frequently asked questions

What is the difference between a second cousin and a first cousin once removed?

+

Second cousins are the same generation and share great-grandparents. A first cousin once removed is one generation apart from you, such as your parent’s first cousin or your first cousin’s child.

How do I calculate how I am related to someone?

+

Find the closest ancestor you share and count the generations from each of you up to that person. The smaller count minus one is the cousin degree, and the difference between the two counts is the number of times removed.

Are third cousins blood relatives?

+

Yes. Third cousins share great-great-grandparents, so they are related by descent, though the shared ancestry is distant.

Can an app tell me how I am related to someone?

+

Yes, if both people are in the same tree with their parent links filled in. A family tree app with a relationship calculator follows those links and names the relation for you.

What is a half-cousin?

+

Half-cousins share only one grandparent instead of a couple, usually because their parents are half-siblings. The degree and ‘removed’ rules stay the same; only the ‘half’ is added.

A relationship calculator is a short, elegant piece of logic: climb to the common ancestor, count the steps, read off the word. The hard part is a complete tree, and that is a job for the whole family.

How we research: Guides are written from established sources and checked for accuracy. They are general information, not professional advice.

Written by

Plugpixels Editorial Team

Technology

Our writers have spent years taking devices apart, on the bench and on paper, and explain them in plain language.

More Stories

View all →