{
  "id": "ratio",
  "version": "408755f4ced8",
  "status": "published",
  "name": "Ratio Calculator",
  "question": "How do I solve a ratio?",
  "summary": "Solves A : B = C : D for any missing number, and shows the ratio in simplest form, as a decimal, and as a scale factor.",
  "category": "math",
  "subcategory": "arithmetic",
  "url": "https://www.acalculator.org/math/ratio-calculator",
  "markdown": "https://www.acalculator.org/math/ratio-calculator.md",
  "kind": "formulas",
  "method": "A : B = C : D means A ÷ B = C ÷ D, so A × D = B × C.",
  "assumptions": [
    "All four terms are more than 0.",
    "The simplest form is shown when it needs whole numbers of a billion or less; decimals are taken exactly as they print (0.1 is 1/10)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "A",
        "description": "The first term of the first ratio, A : B.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "b": {
        "title": "B",
        "description": "The second term of the first ratio, A : B.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "c": {
        "title": "C",
        "description": "The first term of the second ratio, C : D.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "d": {
        "title": "D",
        "description": "The second term of the second ratio, C : D.",
        "type": "number",
        "exclusiveMinimum": 0
      }
    }
  },
  "solve": {
    "fillAny": 3,
    "variables": [
      "a",
      "b",
      "c",
      "d"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "A": {
      "label": "A",
      "description": "The first term of the first ratio, A : B.",
      "format": "number"
    },
    "B": {
      "label": "B",
      "description": "The second term of the first ratio, A : B.",
      "format": "number"
    },
    "C": {
      "label": "C",
      "description": "The first term of the second ratio, C : D.",
      "format": "number"
    },
    "D": {
      "label": "D",
      "description": "The second term of the second ratio, C : D.",
      "format": "number"
    },
    "simplest": {
      "label": "Simplest form",
      "description": "A : B in lowest whole-number terms, such as 3 : 4.",
      "format": "text"
    },
    "decimal": {
      "label": "As a decimal",
      "description": "The value of the ratio: A ÷ B.",
      "format": "number"
    },
    "scale": {
      "label": "Scale factor",
      "description": "How many times bigger C : D is than A : B: C ÷ A.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": 3,
      "b": 4,
      "c": 6
    },
    "outputs": {
      "D": 8,
      "simplest": "3 : 4",
      "decimal": 0.75,
      "scale": 2
    },
    "text": "3 : 4 = 6 : 8."
  },
  "examples": [
    {
      "given": {
        "a": 3,
        "b": 4,
        "c": 6
      },
      "expect": {
        "d": 8,
        "simplest": "3 : 4",
        "decimal": 0.75,
        "scale": 2
      },
      "source": "hand calculation in content.mdx: D = 4 × 6 ÷ 3 = 8"
    },
    {
      "given": {
        "a": 5,
        "c": 15,
        "d": 21
      },
      "expect": {
        "b": 7,
        "scale": 3
      },
      "source": "hand calculation in content.mdx: B = 5 × 21 ÷ 15 = 7"
    },
    {
      "given": {
        "a": 1.5,
        "b": 2,
        "c": 4.5
      },
      "expect": {
        "d": 6,
        "simplest": "3 : 4",
        "decimal": 0.75
      },
      "source": "hand calculation in content.mdx: D = 2 × 4.5 ÷ 1.5 = 6; 1.5 : 2 = 15 : 20 = 3 : 4"
    },
    {
      "given": {
        "b": 9,
        "c": 32,
        "d": 18
      },
      "expect": {
        "a": 16,
        "simplest": "16 : 9"
      },
      "source": "hand calculation in content.mdx: A = 9 × 32 ÷ 18 = 16"
    },
    {
      "given": {
        "a": 1920,
        "b": 1080,
        "d": 720
      },
      "expect": {
        "c": 1280,
        "simplest": "16 : 9"
      },
      "source": "hand calculation in content.mdx: C = 1920 × 720 ÷ 1080 = 1280; 1920 : 1080 = 16 : 9"
    }
  ],
  "sources": [
    "OpenStax, Elementary Algebra 2e, section 8.7 Solve Proportion and Similar Figure Applications: https://openstax.org/books/elementary-algebra-2e/pages/8-7-solve-proportion-and-similar-figure-applications"
  ],
  "related": [
    "fraction",
    "percentage",
    "gcf"
  ],
  "changelog": []
}
