{
  "id": "unit-rate",
  "version": "6c4a16a9af20",
  "status": "published",
  "name": "Unit Rate Calculator",
  "question": "What is the unit rate?",
  "summary": "Turns a rate such as 455 miles on 14 gallons into a unit rate, the amount per 1 unit (32.5 miles per gallon), with the rate the other way round and the simplest ratio.",
  "category": "math",
  "subcategory": "arithmetic",
  "url": "https://www.acalculator.org/math/unit-rate-calculator",
  "markdown": "https://www.acalculator.org/math/unit-rate-calculator.md",
  "kind": "function",
  "method": "unit rate = amount ÷ second quantity; the other way round = second quantity ÷ amount.",
  "assumptions": [
    "Typed decimals are read exactly, so 3.99 ÷ 24 is exactly 0.16625 and a shown rate rounds half up.",
    "The unit names are only labels; the calculator does not convert units.",
    "In the words, the unit after \"per\" drops a final \"s\" unless the letter before it is s or u (gallons becomes gallon)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "Amount",
        "description": "The first quantity of the rate, such as 455 miles or $3.99.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000000
      },
      "au": {
        "title": "Unit of the amount",
        "description": "What the amount counts, such as miles or dollars.",
        "type": "string",
        "maxLength": 40
      },
      "b": {
        "title": "Per",
        "description": "The second quantity, such as 14 gallons or 24 bottles. It is more than 0.",
        "type": "number",
        "minimum": 1e-15,
        "maximum": 1000000000000000
      },
      "bu": {
        "title": "Unit of the second quantity",
        "description": "What the second quantity counts, such as gallons.",
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "outputs": {
    "rate": {
      "label": "Unit rate",
      "description": "Amount ÷ second quantity: how much for 1 unit of the second quantity.",
      "format": "number"
    },
    "sentence": {
      "label": "In words",
      "description": "The unit rate with its units, to 10 significant figures.",
      "format": "text"
    },
    "inverse": {
      "label": "The other way round",
      "description": "Second quantity ÷ amount: how much of the second quantity for 1 unit of the amount.",
      "format": "number"
    },
    "inverseSentence": {
      "label": "The other way round, in words",
      "description": "The inverse rate with its units, to 10 significant figures.",
      "format": "text"
    },
    "ratio": {
      "label": "Simplest ratio",
      "description": "Amount : second quantity as the smallest whole numbers with the same ratio.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": 455,
      "au": "miles",
      "b": 14,
      "bu": "gallons"
    },
    "outputs": {
      "rate": 32.5,
      "sentence": "32.5 miles per gallon",
      "inverse": 0.03076923076923077,
      "inverseSentence": "0.03076923077 gallons per mile",
      "ratio": "65 : 2"
    },
    "text": "The unit rate is 32.5 miles per gallon."
  },
  "examples": [
    {
      "given": {
        "a": 455,
        "au": "miles",
        "b": 14,
        "bu": "gallons"
      },
      "expect": {
        "rate": 32.5,
        "sentence": "32.5 miles per gallon",
        "ratio": "65 : 2",
        "inverse": 0.03076923076923077
      },
      "source": "OpenStax, Prealgebra 2e, §5.6 Ratios and Rate (a unit rate is a rate with denominator of 1 unit; Examples 5.64 to 5.66), https://openstax.org/books/prealgebra-2e/pages/5-6-ratios-and-rate (retrieved 2026-10-02), Example 5.65: 455 ÷ 14 = 32.5 miles per gallon"
    },
    {
      "given": {
        "a": 384,
        "au": "dollars",
        "b": 32,
        "bu": "hours"
      },
      "expect": {
        "rate": 12,
        "sentence": "12 dollars per hour",
        "ratio": "12 : 1"
      },
      "source": "OpenStax, Prealgebra 2e, §5.6 Ratios and Rate (a unit rate is a rate with denominator of 1 unit; Examples 5.64 to 5.66), https://openstax.org/books/prealgebra-2e/pages/5-6-ratios-and-rate (retrieved 2026-10-02), Example 5.64: $384 for 32 hours is $12 per hour"
    },
    {
      "given": {
        "a": 3.99,
        "au": "dollars",
        "b": 24,
        "bu": "bottles"
      },
      "expect": {
        "rate": 0.16625,
        "ratio": "133 : 800",
        "sentence": "0.16625 dollars per bottle"
      },
      "source": "OpenStax, Prealgebra 2e, §5.6 Ratios and Rate (a unit rate is a rate with denominator of 1 unit; Examples 5.64 to 5.66), https://openstax.org/books/prealgebra-2e/pages/5-6-ratios-and-rate (retrieved 2026-10-02), Example 5.66: $3.99 for 24 bottles is about $0.17 per bottle; hand calculation in content.mdx: 3.99 ÷ 24 = 0.16625"
    }
  ],
  "sources": [
    "OpenStax, Prealgebra 2e, §5.6 Ratios and Rate (rates, unit rates and unit price; Examples 5.64, 5.65 and 5.66), CC BY 4.0. https://openstax.org/books/prealgebra-2e/pages/5-6-ratios-and-rate (retrieved 2026-10-02)"
  ],
  "related": [
    "rate",
    "ratio",
    "proportion",
    "unit-price"
  ],
  "changelog": []
}
