Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Rectangular Prism Volume Calculator (Length × Width × Height)

Enter the length, width and height of the box. The volume (length × width × height) is shown, along with conversions to liters (L) and cubic meters (m³).

Use the same unit for all three and enter only numbers greater than 0 (numbers only, no units. For 30 cm, enter "30").
Result and figure
Enter the length, width and height in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter the three lengths (length, width and height), and the volume of the rectangular prism (volume = length × width × height) is calculated on the spot
  • The result also shows the volume in other units: US gallons and cubic feet if you enter inches, and US gallons if you enter feet. Switch "Units" to Metric to get liters and cubic meters instead
  • The result is also drawn as a 3D shape. Drag it with the mouse to turn it around and check its shape and size
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
Enter the length, width and height in the same unit (all in inches, or all in feet). Which side you call the length or the width does not change the answer. The volumes of other solids, such as cubes, cylinders and spheres, have their own pages.

What is this calculation used for?

Finding how much water an aquarium holds (fish and pets)

A standard 10-gallon aquarium is 20 in long, 10 in wide and 12 in tall. Its volume is \(20 \times 10 \times 12 = 2400\,\mathrm{in^3}\), which is \(2400 \div 231 \approx 10.4\) gallons (in practice you do not fill it to the brim, so it holds a little less water).
Heater wattage, filter capacity and how many fish you can keep are all rated "per gallon", so choosing an aquarium starts with this calculation.

Comparing the water in a bath and a shower (home and savings)

If the inside of a bathtub is 50 in long and 22 in wide and you fill it 12 in deep, the water is \(50 \times 22 \times 12 = 13200\,\mathrm{in^3}\), or about \(13200 \div 231 \approx 57\) gallons (real tubs have sloped sides, so it is a little less).
A US showerhead uses at most 2.5 gallons per minute, so a 10-minute shower uses about 25 gallons or less. Comparing a bath with a shower, like many ways to save water, starts with a volume calculation.

Calculating the dimensional weight of a package (shipping)

Carriers charge not only by actual weight but also by "dimensional weight". A common formula is "length × width × height (in inches) ÷ 139". A box 24 in by 16 in by 12 in has a volume of \(24 \times 16 \times 12 = 4608\,\mathrm{in^3}\), so its dimensional weight is \(4608 \div 139 \approx 33.2\) lb, which is rounded up to 34 lb.
The lighter and bulkier a package is, the more its volume matters, so this calculation is used every day in shipping.

Estimating the soil for a raised garden bed (gardening)

To fill a raised bed that is 8 ft long, 4 ft wide and 1 ft deep, you need \(8 \times 4 \times 1 = 32\,\mathrm{ft^3}\) of soil.
Bagged soil is sold by volume, such as 2 cubic feet per bag, so \(32 \div 2 = 16\) bags will do. For a bulk delivery, which is sold by the cubic yard, it is \(32 \div 27 \approx 1.2\) yd³. This calculation helps you avoid buying too much or too little.

Using the volume of a room to choose fans and air purifiers (home and appliances)

A room that is 12 ft long and 10 ft wide with an 8 ft ceiling holds \(12 \times 10 \times 8 = 960\,\mathrm{ft^3}\) of air.
Fans and air purifiers are rated in cubic feet per minute (CFM). A fan that moves 80 CFM takes \(960 \div 80 = 12\) minutes to move the same amount of air as the whole room, so knowing the room volume lets you read these numbers.

Formulas and figures

Volume of a rectangular prism
Figure
Standard notation (the usual math form)
\(V\) \(=\) \(l\) \(\times\) \(w\) \(\times\) \(h\)
In words (symbols replaced with words)
④ \(V\): volume \(=\) ① \(l\): length \(\times\) ② \(w\): width \(\times\) ③ \(h\): height
The formula in words
① Take the \(l\): length
② multiply it by the \(w\): width
③ multiply that by the \(h\): height
④ and you get the \(V\): volume
Quick example
The volume of a box that is 5 in long, 8 in wide and 4 in tall is
\(V\): volume \(=\) length (5 in) \(\times\) width (8 in) \(\times\) height (4 in)
\(5 \times 8 \times 4 = 160\,\mathrm{in^3}\)
Key idea
Why do three multiplications give the volume? Volume counts how many unit cubes fit inside, here cubes that are 1 inch on each side (1 in³). In a box 5 in long, 8 in wide and 4 in tall, the bottom layer holds \(5 \times 8 = 40\) of these cubes, and there are 4 layers stacked up, so there are \(40 \times 4 = 160\) cubes in all. That is 160 in³. Always use the same unit for the length, width and height. If all three are in inches, the answer is in cubic inches (in³); if all three are in feet, it is in cubic feet (ft³).
Base area × height (volume of a prism)
Figure
Standard notation (the usual math form)
\(V\) \(=\) \(S\) \(\times\) \(h\)
In words (symbols replaced with words)
③ \(V\): volume \(=\) ① \(S\): area of the base \(\times\) ② \(h\): height
The formula in words
① Take the \(S\): area of the base
② multiply it by the \(h\): height
③ and you get the \(V\): volume
Quick example
The volume of a box that is 5 in long and 8 in wide (base area 40 in²) and 4 in tall is
\(V\): volume \(=\) area of the base (40 in²) \(\times\) height (4 in)
\(5 \times 8 = 40\,\mathrm{in^2}\)
\(40 \times 4 = 160\,\mathrm{in^3}\)
Key idea
The "length × width" part is exactly the area of the rectangle at the bottom (the area of the base). So the volume of a rectangular prism can also be read as "area of the base × height". Many US textbooks write this as \(V = Bh\), with \(B\) for the area of the base. The nice thing about this view is that it works even when the base is not a rectangle. Whether the base is a triangle or a circle, the volume of any prism or cylinder is "area of the base × height". The box formula is the simplest case of this rule.
Converting volume units (in³ to ft³)
Figure
Standard notation (the usual math form)
\(V_{\mathrm{ft^3}}\) \(=\) \(V_{\mathrm{in^3}}\) \(\div\) \(1728\)
In words (symbols replaced with words)
③ \(V_{\mathrm{ft^3}}\): volume in ft³ \(=\) ① \(V_{\mathrm{in^3}}\): volume in in³ \(\div\) ② \(1728\): cubic inches in 1 ft³
The formula in words
① Take the \(V_{\mathrm{in^3}}\): volume in in³
② divide it by \(1728\): cubic inches in 1 ft³
③ and you get the \(V_{\mathrm{ft^3}}\): volume in ft³
Quick example
A 10-gallon aquarium that is 20 in by 10 in and 12 in tall holds 2400 in³. In cubic feet, that is
volume in ft³ \(=\) volume in in³ (2400) \(\div\) cubic inches in 1 ft³ (1728)
\(2400 \div 1728 \approx 1.39\,\mathrm{ft^3}\)
Key idea
\(1\,\mathrm{ft^3}\) is the space inside a cube that is 1 foot (12 inches) on each side, so it holds \(12 \times 12 \times 12 = 1728\,\mathrm{in^3}\). That is why you divide cubic inches by 1728 to get cubic feet. For liquids, 1 US gallon is \(231\,\mathrm{in^3}\), so the same tank holds \(2400 \div 231 \approx 10.4\) gallons, which is why it is sold as a 10-gallon tank. The conversion factor for volume is the length factor cubed. Since 1 yd = 3 ft, \(1\,\mathrm{yd^3} = 3 \times 3 \times 3 = 27\,\mathrm{ft^3}\). A common mistake is to multiply by 3 or by 9 instead of 27.
The volume of a rectangular prism is length × width × height. Since length × width is the area of the base, it can also be read as "area of the base × height", a view that works for every prism and cylinder. To convert cubic inches to cubic feet, divide by 1728; to get US gallons, divide by 231.

Symbols and terms

Symbols

\(V\) vee The usual symbol for volume, from the first letter of "volume".
\(l\) ell The length of the box, from the first letter of "length".
\(w\) double-u The width of the box, from the first letter of "width".
\(h\) aitch The height of the box, from the first letter of "height".
\(S\) ess The area of the base (the rectangle at the bottom). On this page, \(S = l \times w\). Many US textbooks use \(B\) for the same thing.
\(\mathrm{in^3}\) cubic inches A unit of volume. A cube that is 1 inch on each side has a volume of 1 in³. Do not mix it up with in² (square inches), which is a unit of area.
\(\mathrm{ft^3}\) cubic feet A unit of volume. A cube that is 1 foot on each side has a volume of 1 ft³. \(1\,\mathrm{ft^3} = 1728\,\mathrm{in^3} \approx 7.48\) gallons, and \(1\,\mathrm{yd^3} = 27\,\mathrm{ft^3}\).
\(\mathrm{gal}\) gallons A unit for amounts of liquid such as water. 1 US gallon is exactly \(231\,\mathrm{in^3}\) (about 3.785 liters), and 1 gallon = 4 quarts.

Terms

rectangular prism A box shape whose 6 faces are all rectangles (some may be squares). Tissue boxes, bricks and fish tanks are all rectangular prisms, the most common solid around us.
cube A solid whose 6 faces are all identical squares, the shape of a die. It is a special rectangular prism whose length, width and height are all equal.
volume The amount of space a solid takes up, given as a number. It is measured by how many unit cubes, such as 1-inch cubes (1 in³), fit inside.
area of the base The area of the bottom face of a solid. For a rectangular prism, it is the area of the bottom rectangle (length × width). "Area of the base × height" is the basic way to find the volume of a prism or cylinder.
prism A solid made by stacking a polygon straight up without changing its shape. A rectangular prism is a prism whose base is a rectangle.
unit conversion Writing the same amount in a different unit. For volume, the key point is that the volume factor is the length factor cubed (1 ft = 12 in, so 1 ft³ = 1728 in³).

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Multiplication (Grades 3–4)
  • Knowing the times tables and multiplying three numbers in order, such as 3 × 4 × 5
Rectangular prisms and cubes (Grades 4–5)
  • Telling a rectangular prism (a box whose 6 faces are rectangles) from a cube (a die shape whose 6 faces are squares)
  • Pointing out the length, width and height on a drawing of a box
What volume is and its units (Grade 5)
  • Knowing that volume can be counted as the number of unit cubes, such as 1-inch cubes (1 in³), that fit inside
  • Reading and writing units such as in³ and ft³, and knowing that \(1\,\mathrm{ft^3} = 1728\,\mathrm{in^3}\)
  • Knowing that 1 US gallon is \(231\,\mathrm{in^3}\)
Multiplying decimals (Grades 5–6)
  • Multiplying decimals such as \(3.5 \times 2.5\) (used when lengths are measured in feet, like 3.5 ft)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the volume of a rectangular prism
Length (in) 10
Width (in) 20
Height (in) 12
Volume (in³) =B1*B2*B3
Table to find it as "area of the base × height"
Length (in) 10
Width (in) 20
Height (in) 12
Area of the base (in²) =B1*B2
Volume (in³) =B4*B3
Table to convert cubic inches to cubic feet
Volume in in³ 2400
Volume in ft³ =B1/1728
After pasting, column A holds the labels and column B holds the numbers. The upper rows are your inputs, and the formulas in the lower rows calculate automatically from them.
In a formula, "B1" and "B2" mean "use the number in that cell", "*" is multiplication and "/" is division.
In the first table, for example, B4 shows 10 × 20 × 12 = 2400 (in³, since the inputs are in inches). The second table shows the same 2400 in B5, and the third table shows about 1.39 (ft³) in B2. To get US gallons instead, change "/1728" to "/231" (about 10.39 gallons). Just replace the input numbers with your own lengths.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the volume of a rectangular prism
Length (in) 10
Width (in) 20
Height (in) 12
Volume (in³) =B1*B2*B3
Table to find it as "area of the base × height"
Length (in) 10
Width (in) 20
Height (in) 12
Area of the base (in²) =B1*B2
Volume (in³) =B4*B3
Table to convert cubic inches to cubic feet
Volume in in³ 2400
Volume in ft³ =B1/1728
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the input numbers with your own lengths.

How to calculate it in Python

length = 10   # length (inches in this example)
width = 20    # width (same unit as length)
height = 12   # height (same unit as length)

volume = length * width * height   # volume (input unit cubed, in3 in this example)
volume_gal = volume / 231          # in US gallons (for inputs in inches)
volume_ft3 = volume / 1728         # in cubic feet (for inputs in inches)

print(f"Volume: {volume} in3")
print(f"In US gallons: {volume_gal} gal")
print(f"In cubic feet: {volume_ft3} ft3")
Runs with the standard library only. "*" is multiplication and "/" is division. Change the length, width and height at the top and run it. This example uses inches; if you use feet, the volume is in cubic feet, and multiplying it by 1728 and dividing by 231 gives US gallons.

How to write it in LaTeX and other math languages (copy and paste)

Volume of a rectangular prism
V = l × w × h
V = l \times w \times h
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>V</mi>
    <mo>=</mo>
    <mi>l</mi>
    <mo>&#xD7;</mo>
    <mi>w</mi>
    <mo>&#xD7;</mo>
    <mi>h</mi>
  </mrow>
</math>
V = l xx w xx h
l*w*h
V := l*w*h;
V = l*w*h;
V = l × w × h
Base area × height (volume of a prism)
V = S × h
V = S \times h
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>V</mi>
    <mo>=</mo>
    <mi>S</mi>
    <mo>&#xD7;</mo>
    <mi>h</mi>
  </mrow>
</math>
V = S xx h
s*h
V := S*h;
V = S*h;
V = S × h
Converting volume units (in³ to ft³)
V[ft³] = V[in³] ÷ 1728
V_{\mathrm{ft^3}} = V_{\mathrm{in^3}} \div 1728
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>V</mi><mrow><msup><mi mathvariant="normal">ft</mi><mn>3</mn></msup></mrow></msub>
    <mo>=</mo>
    <msub><mi>V</mi><mrow><msup><mi mathvariant="normal">in</mi><mn>3</mn></msup></mrow></msub>
    <mo>&#xF7;</mo>
    <mn>1728</mn>
  </mrow>
</math>
V_(ft^3) = V_(in^3) -: 1728
vIn3/1728
vFt3 := vIn3/1728;
v_ft3 = v_in3/1728;
V(ft³) = V(in³)/1728

How to have ChatGPT  do the calculation

You are a math calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

An aquarium shaped like a rectangular prism is 20 inches long, 10 inches wide and 12 inches tall.
Find each of the following:
1. The volume of the aquarium in cubic inches (in³)
2. That volume in US gallons (1 gallon = 231 in³)

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.