{
  "id": "cousin",
  "version": "9a701249cef2",
  "status": "published",
  "name": "Cousin Calculator",
  "question": "What cousin are we?",
  "summary": "Names how two relatives are related, such as second cousin once removed or grandaunt, from how many generations each is below the ancestor they share.",
  "category": "everyday-life",
  "subcategory": "fun",
  "url": "https://www.acalculator.org/everyday-life/cousin-calculator",
  "markdown": "https://www.acalculator.org/everyday-life/cousin-calculator.md",
  "kind": "function",
  "method": "With a and b the generations each person is below the most recent common ancestor: cousins (a, b ≥ 2) are (min(a, b) − 1)th cousins, |a − b| times removed; a = 1 or b = 1 gives siblings, aunts, uncles, nieces and nephews; a = 0 or b = 0 a direct line.",
  "assumptions": [
    "The common ancestor is the most recent one the two people share.",
    "Names are the same for half relatives (who share one ancestor of a couple instead of both); genealogists then add “half”."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "You are the ancestor’s",
        "description": "How many generations you are below the most recent ancestor you both share.",
        "type": "string",
        "enum": [
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ]
      },
      "b": {
        "title": "They are the ancestor’s",
        "description": "How many generations your relative is below that same ancestor.",
        "type": "string",
        "enum": [
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ]
      }
    }
  },
  "outputs": {
    "relationship": {
      "label": "They are your",
      "description": "What your relative is to you.",
      "format": "text"
    },
    "reverse": {
      "label": "You are their",
      "description": "What you are to your relative.",
      "format": "text"
    },
    "degree": {
      "label": "Cousin degree",
      "description": "Fewer generations − 1, for cousins: 1 for first cousins, 2 for second.",
      "format": "integer"
    },
    "removedBy": {
      "label": "Times removed",
      "description": "The generation gap between you, for cousins.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": "3",
      "b": "4"
    },
    "outputs": {
      "relationship": "2nd cousin once removed",
      "reverse": "2nd cousin once removed",
      "degree": 2,
      "removedBy": 1
    },
    "text": "They are your 2nd cousin once removed, and you are their 2nd cousin once removed."
  },
  "examples": [
    {
      "given": {
        "a": "2",
        "b": "2"
      },
      "expect": {
        "relationship": "1st cousin",
        "degree": 1,
        "removedBy": 0
      },
      "source": "FamilySearch, What Is a Second Cousin? Cousin Relationships Explained (first cousins share a grandparent, second cousins a great-grandparent; removed is the generation gap), https://www.familysearch.org/en/blog/what-is-a-second-cousin (retrieved 2026-10-18)"
    },
    {
      "given": {
        "a": "3",
        "b": "4"
      },
      "expect": {
        "relationship": "2nd cousin once removed",
        "reverse": "2nd cousin once removed",
        "degree": 2,
        "removedBy": 1
      },
      "source": "FamilySearch, What Is a Second Cousin? Cousin Relationships Explained (first cousins share a grandparent, second cousins a great-grandparent; removed is the generation gap), https://www.familysearch.org/en/blog/what-is-a-second-cousin (retrieved 2026-10-18); hand calculation in content.mdx: degree min(3, 4) − 1 = 2, removed 4 − 3 = 1"
    },
    {
      "given": {
        "a": "3",
        "b": "1"
      },
      "expect": {
        "relationship": "grandaunt or granduncle",
        "reverse": "grandniece or grandnephew"
      },
      "source": "Family Tree Magazine, How to Refer to Aunts and Uncles: Grand, Not Great (aunt, grandaunt, great-grandaunt; a sibling’s grandchild is a grandniece or grandnephew), https://familytreemagazine.com/general-genealogy/aunts-and-uncles-grand-not-great/ (retrieved 2026-10-18)"
    },
    {
      "given": {
        "a": "2",
        "b": "5"
      },
      "expect": {
        "relationship": "1st cousin 3 times removed",
        "degree": 1,
        "removedBy": 3
      },
      "source": "FamilySearch, What Is a Second Cousin? Cousin Relationships Explained (first cousins share a grandparent, second cousins a great-grandparent; removed is the generation gap), https://www.familysearch.org/en/blog/what-is-a-second-cousin (retrieved 2026-10-18); hand calculation in content.mdx: min(2, 5) − 1 = 1, 5 − 2 = 3"
    },
    {
      "given": {
        "a": "0",
        "b": "6"
      },
      "expect": {
        "relationship": "4th great-grandchild",
        "reverse": "4th great-grandparent"
      },
      "source": "Family Tree Magazine, How to Refer to Aunts and Uncles: Grand, Not Great (aunt, grandaunt, great-grandaunt; a sibling’s grandchild is a grandniece or grandnephew), https://familytreemagazine.com/general-genealogy/aunts-and-uncles-grand-not-great/ (retrieved 2026-10-18); hand calculation in content.mdx: 6 generations is a grandchild with 6 − 2 = 4 greats, written 4th great-grandchild"
    }
  ],
  "sources": [
    "FamilySearch, What Is a Second Cousin?—Cousin Relationships Explained (cousins share an ancestor at least 2 generations back; first cousins share a grandparent, second cousins a great-grandparent; “removed” is the generation gap). https://www.familysearch.org/en/blog/what-is-a-second-cousin (retrieved 2026-10-18)",
    "Family Tree Magazine, Genealogy Q&A: How to Refer to Aunts and Uncles: Grand, Not Great (parent, aunt or uncle; grandparent, grandaunt or granduncle; great-grandparent, great-grandaunt; a sibling’s grandchild is a grandniece or grandnephew). https://familytreemagazine.com/general-genealogy/aunts-and-uncles-grand-not-great/ (retrieved 2026-10-18)"
  ],
  "related": [
    "age-difference"
  ],
  "changelog": []
}
