{
  "id": "simplify-fraction",
  "version": "734c6d307ef8",
  "status": "published",
  "name": "Simplify Fractions Calculator",
  "question": "How do I simplify fractions?",
  "summary": "Reduces a fraction to lowest terms by dividing the numerator and the denominator by their greatest common factor, with the working.",
  "category": "math",
  "subcategory": "fractions",
  "url": "https://www.acalculator.org/math/simplify-fraction-calculator",
  "markdown": "https://www.acalculator.org/math/simplify-fraction-calculator.md",
  "kind": "function",
  "method": "a/b = (a ÷ g)/(b ÷ g), where g = GCF(a, b) is found with Euclid's algorithm: divide the larger number by the smaller, then the smaller by the remainder, until the remainder is 0; the last divisor is g.",
  "assumptions": [
    "The numerator and the denominator are whole numbers; the arithmetic is exact for numbers of any size up to 30 digits.",
    "A minus sign on the denominator moves to the numerator, so the simplest form has a positive denominator.",
    "The denominator cannot be 0."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "n": {
        "title": "Numerator (top)",
        "description": "The top number of the fraction, a whole number that may be negative.",
        "type": "string",
        "pattern": "^-?\\d+$"
      },
      "d": {
        "title": "Denominator (bottom)",
        "description": "The bottom number of the fraction, a whole number other than 0.",
        "type": "string",
        "pattern": "^-?\\d+$"
      }
    }
  },
  "outputs": {
    "simplified": {
      "label": "Simplest form",
      "description": "The fraction in lowest terms with a positive denominator, or a whole number.",
      "format": "text"
    },
    "gcf": {
      "label": "Greatest common factor",
      "description": "The largest whole number that divides both the numerator and the denominator.",
      "format": "integer"
    },
    "mixed": {
      "label": "As a mixed number",
      "description": "An improper fraction as a whole number and a proper fraction, such as 2 7/22.",
      "format": "text"
    },
    "decimal": {
      "label": "As a decimal",
      "description": "The value of the fraction as a decimal.",
      "format": "number"
    },
    "fraction": {
      "label": "Fraction",
      "description": "The fraction as typed, numerator over denominator.",
      "format": "text"
    },
    "steps": {
      "label": "Working",
      "description": "Euclid's algorithm for the greatest common factor, then the division of both parts.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "n": 42,
      "d": 56
    },
    "outputs": {
      "simplified": "3/4",
      "gcf": "14",
      "decimal": 0.75,
      "fraction": "42/56",
      "steps": "56 = 1 × 42 + 14; 42 = 3 × 14 + 0; GCF(42, 56) = 14; Divide the top and the bottom by 14: 42 ÷ 14 = 3 and 56 ÷ 14 = 4; 42/56 = 3/4"
    },
    "text": "42/56 in simplest form is 3/4."
  },
  "examples": [
    {
      "given": {
        "n": "42",
        "d": "56"
      },
      "expect": {
        "simplified": "3/4",
        "gcf": "14",
        "decimal": 0.75,
        "steps": "56 = 1 × 42 + 14; 42 = 3 × 14 + 0; GCF(42, 56) = 14; Divide the top and the bottom by 14: 42 ÷ 14 = 3 and 56 ÷ 14 = 4; 42/56 = 3/4"
      },
      "source": "hand calculation in content.mdx (Euclid's algorithm); Python 3: math.gcd(42, 56) = 14, Fraction(42, 56) = 3/4; method from OpenStax Prealgebra 2e, section 4.2: https://openstax.org/books/prealgebra-2e/pages/4-2-multiply-and-divide-fractions"
    },
    {
      "given": {
        "n": "1071",
        "d": "462"
      },
      "expect": {
        "simplified": "51/22",
        "gcf": "21",
        "mixed": "2 7/22",
        "decimal": 2.3181818181818183
      },
      "source": "Euclid's worked example gcd(1071, 462) = 21 (Wikipedia, Euclidean algorithm); hand calculation in content.mdx; Python 3: Fraction(1071, 462) = 51/22"
    },
    {
      "given": {
        "n": "18",
        "d": "-24"
      },
      "expect": {
        "simplified": "-3/4",
        "gcf": "6",
        "steps": "Move the minus sign to the top: 18/-24 = -18/24; 24 = 1 × 18 + 6; 18 = 3 × 6 + 0; GCF(18, 24) = 6; Divide the top and the bottom by 6: 18 ÷ 6 = 3 and 24 ÷ 6 = 4; 18/-24 = -3/4"
      },
      "source": "hand calculation in content.mdx; Python 3: Fraction(18, -24) = -3/4"
    },
    {
      "given": {
        "n": "100",
        "d": "25"
      },
      "expect": {
        "simplified": "4",
        "gcf": "25",
        "decimal": 4
      },
      "source": "hand calculation in content.mdx: 100 = 4 × 25 + 0"
    },
    {
      "given": {
        "n": "7",
        "d": "13"
      },
      "expect": {
        "simplified": "7/13",
        "gcf": "1"
      },
      "source": "hand calculation in content.mdx: 13 = 1 × 7 + 6, 7 = 1 × 6 + 1, 6 = 6 × 1 + 0"
    }
  ],
  "sources": [
    "OpenStax, Prealgebra 2e, section 4.2 Multiply and Divide Fractions (simplify fractions, the equivalent fractions property): https://openstax.org/books/prealgebra-2e/pages/4-2-multiply-and-divide-fractions",
    "Euclid, Elements, Book VII, Propositions 1 and 2 (the greatest common measure of two numbers)"
  ],
  "related": [
    "fraction",
    "gcf",
    "mixed-numbers",
    "fraction-to-decimal"
  ],
  "changelog": []
}
