{
  "id": "geometric-mean",
  "version": "6a960597fbab",
  "status": "published",
  "name": "Geometric Mean Calculator",
  "question": "What is the geometric mean?",
  "summary": "Computes the geometric mean of a list of positive numbers, the nth root of their product, with the arithmetic and harmonic means for comparison.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/geometric-mean-calculator",
  "markdown": "https://www.acalculator.org/statistics/geometric-mean-calculator.md",
  "kind": "function",
  "method": "GM = (x₁ × x₂ × … × xₙ)^(1/n) = exp((ln x₁ + … + ln xₙ) ÷ n); AM = Σx ÷ n; HM = n ÷ Σ(1/x).",
  "assumptions": [
    "Every number is 0 or more. With a 0 in the list, the geometric mean is 0 and the harmonic mean is not shown.",
    "For growth rates, enter growth factors: +5% is 1.05 and −3% is 0.97. The average rate is the geometric mean minus 1."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "data": {
        "title": "Your numbers",
        "description": "Positive numbers (0 is allowed), separated by commas, spaces, semicolons, or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  },
  "outputs": {
    "gm": {
      "label": "Geometric mean",
      "description": "The nth root of the product of the n numbers.",
      "format": "number"
    },
    "am": {
      "label": "Arithmetic mean",
      "description": "The sum divided by the count.",
      "format": "number"
    },
    "hm": {
      "label": "Harmonic mean",
      "description": "The count divided by the sum of the reciprocals. It is not shown when a number is 0.",
      "format": "number"
    },
    "n": {
      "label": "Count (n)",
      "description": "How many numbers are in the list.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "data": "10, 51.2, 8"
    },
    "outputs": {
      "gm": 16,
      "am": 23.066666666666666,
      "hm": 12.268370607028753,
      "n": 3
    },
    "text": "The geometric mean of the 3 numbers is 16."
  },
  "examples": [
    {
      "given": {
        "data": [
          10,
          51.2,
          8
        ]
      },
      "expect": {
        "gm": 16,
        "am": 23.066666666666666,
        "hm": 12.268370607028753,
        "n": 3
      },
      "source": "OpenStax, Introductory Business Statistics, §2.5 Geometric Mean (x̃ = (x₁ × x₂ × … × xₙ)^(1/n); 10, 51.2 and 8 have product 4,096 and geometric mean 16), https://openstax.org/books/introductory-business-statistics/pages/2-5-geometric-mean (retrieved 2026-10-05); hand calculation in content.mdx: 10 × 51.2 × 8 = 4,096 = 16³; AM = 69.2 ÷ 3; HM = 3 ÷ (0.1 + 0.01953125 + 0.125); Python 3: statistics.geometric_mean, harmonic_mean",
      "tolerance": 1e-12
    },
    {
      "given": {
        "data": [
          2,
          8
        ]
      },
      "expect": {
        "gm": 4,
        "am": 5,
        "hm": 3.2
      },
      "source": "OpenStax, Introductory Business Statistics, §2.5 Geometric Mean (x̃ = (x₁ × x₂ × … × xₙ)^(1/n); 10, 51.2 and 8 have product 4,096 and geometric mean 16), https://openstax.org/books/introductory-business-statistics/pages/2-5-geometric-mean (retrieved 2026-10-05); hand calculation in content.mdx: √(2 × 8) = √16 = 4; HM = 2 ÷ (1/2 + 1/8) = 3.2"
    },
    {
      "given": {
        "data": [
          1.1,
          0.9,
          1.2
        ]
      },
      "expect": {
        "gm": 1.059104500597819,
        "am": 1.0666666666666667
      },
      "source": "OpenStax, Introductory Business Statistics, §2.5 Geometric Mean (x̃ = (x₁ × x₂ × … × xₙ)^(1/n); 10, 51.2 and 8 have product 4,096 and geometric mean 16), https://openstax.org/books/introductory-business-statistics/pages/2-5-geometric-mean (retrieved 2026-10-05); hand calculation in content.mdx: (1.1 × 0.9 × 1.2)^(1/3) = 1.188^(1/3) = 1.059105; Python 3: 1.188 ** (1/3)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "data": [
          5,
          0,
          3
        ]
      },
      "expect": {
        "gm": 0,
        "am": 2.6666666666666665
      },
      "source": "OpenStax, Introductory Business Statistics, §2.5 Geometric Mean (x̃ = (x₁ × x₂ × … × xₙ)^(1/n); 10, 51.2 and 8 have product 4,096 and geometric mean 16), https://openstax.org/books/introductory-business-statistics/pages/2-5-geometric-mean (retrieved 2026-10-05); hand calculation in content.mdx: 5 × 0 × 3 = 0"
    }
  ],
  "sources": [
    "OpenStax, Introductory Business Statistics, §2.5 Geometric Mean: x̃ = (x₁ × x₂ × … × xₙ)^(1/n); 10, 51.2 and 8 have product 4,096 and geometric mean 16. https://openstax.org/books/introductory-business-statistics/pages/2-5-geometric-mean (retrieved 2026-10-05)"
  ],
  "related": [
    "average",
    "mean-median-mode",
    "weighted-average"
  ],
  "changelog": []
}
