{
  "id": "aquarium",
  "version": "f98b4b11dcb4",
  "status": "published",
  "name": "Aquarium Calculator",
  "question": "How many gallons is my aquarium?",
  "summary": "Works out how many gallons or liters a rectangular or cylinder fish tank holds from its inside size, and how much the water weighs.",
  "category": "everyday-life",
  "subcategory": "pets",
  "url": "https://www.acalculator.org/everyday-life/aquarium-calculator",
  "markdown": "https://www.acalculator.org/everyday-life/aquarium-calculator.md",
  "kind": "function",
  "method": "Rectangular: volume = length × width × height; cylinder: volume = π × (diameter ÷ 2)² × height; 1 US gallon = 231 in³; water weight = volume × 0.998 kg/L.",
  "assumptions": [
    "Sizes are inside sizes; outside sizes include the glass and give a little more.",
    "The tank is filled to the height typed; most tanks are filled an inch or two below the rim.",
    "The water is fresh water at 20 °C; gravel, rock and decorations take up some of the volume."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "shape": {
        "title": "Tank shape",
        "description": "A rectangular (box) tank or a round cylinder tank.",
        "type": "string",
        "enum": [
          "box",
          "cylinder"
        ]
      },
      "l": {
        "title": "Length",
        "description": "The inside length of the tank, left to right.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.00254,
        "maximum": 25.4
      },
      "w": {
        "title": "Width",
        "description": "The inside width of the tank, front to back.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.00254,
        "maximum": 25.4
      },
      "dia": {
        "title": "Diameter",
        "description": "The inside diameter of the round tank.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.00254,
        "maximum": 25.4
      },
      "h": {
        "title": "Water depth",
        "description": "The inside height of the tank, or the depth of the water in it.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.00254,
        "maximum": 25.4
      }
    }
  },
  "outputs": {
    "volume": {
      "label": "Volume",
      "description": "The water the tank holds: US gallons in US units, liters in Metric.",
      "format": "quantity",
      "unit": "gal"
    },
    "liters": {
      "label": "Liters",
      "description": "The volume in liters.",
      "format": "number"
    },
    "gallons": {
      "label": "US gallons",
      "description": "The volume ÷ 231 in³.",
      "format": "number"
    },
    "weight": {
      "label": "Water weight",
      "description": "Fresh water at 0.998 kg per liter; salt water, gravel and the tank add more.",
      "format": "quantity",
      "unit": "lb"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "shape": "box",
      "l": 0.6095999999999999,
      "w": 0.30479999999999996,
      "dia": 0.4572,
      "h": 0.4064
    },
    "outputs": {
      "volume": 0.075511590912,
      "liters": 75.511590912,
      "gallons": 19.948051948051948,
      "weight": 75.360567730176
    },
    "text": "The tank holds 19.95 gal of water, which weighs 166.1 lb."
  },
  "examples": [
    {
      "given": {
        "shape": "box",
        "l": 0.6095999999999999,
        "w": 0.30479999999999996,
        "h": 0.4064
      },
      "expect": {
        "gallons": 19.948051948051948,
        "liters": 75.511590912,
        "weight": 75.36056773017599
      },
      "source": "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 US gallon = 231 cubic inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-03); USGS Water Science School, Water Density (about 0.998 g/cm³ at 20 °C), https://www.usgs.gov/water-science-school/science/water-density (retrieved 2026-10-03); hand calculation in content.mdx: 24 × 12 × 16 = 4,608 in³ ÷ 231 = 19.95 gal = 75.51 L; × 0.998 = 75.36 kg (166.1 lb)"
    },
    {
      "given": {
        "shape": "box",
        "l": 1.2,
        "w": 0.5,
        "h": 0.5
      },
      "expect": {
        "liters": 300,
        "gallons": 79.25161570744451,
        "weight": 299.4
      },
      "source": "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 US gallon = 231 cubic inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-03); USGS Water Science School, Water Density (about 0.998 g/cm³ at 20 °C), https://www.usgs.gov/water-science-school/science/water-density (retrieved 2026-10-03); hand calculation in content.mdx: 120 × 50 × 50 = 300,000 cm³ = 300 L = 79.25 gal; 300 × 0.998 = 299.4 kg"
    },
    {
      "given": {
        "shape": "cylinder",
        "dia": 0.4572,
        "h": 0.6095999999999999
      },
      "expect": {
        "gallons": 26.438338175664754
      },
      "source": "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 US gallon = 231 cubic inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-03); hand calculation in content.mdx: π × 9² × 24 = 6,107.3 in³ ÷ 231 = 26.44 gal",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 US gallon = 231 cubic inches; 1 inch = 2.54 centimeters exactly). https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-03)",
    "USGS Water Science School, Water Density (fresh water is about 0.998 g/cm³ at 20 °C). https://www.usgs.gov/water-science-school/science/water-density (retrieved 2026-10-03)"
  ],
  "related": [
    "pool-volume",
    "cubic-feet",
    "pipe-volume"
  ],
  "changelog": []
}
