The volume of a pipe tells you how much water a line will hold, how much will drain out when you open it, or how much fluid you need to fill it. A pipe is a long cylinder, so the calculation is short. The only trap is which diameter to use.
Updated November 2026
Use the inside diameter
Pipe is sold by nominal size, and the actual bore depends on the material and wall thickness. A thicker wall leaves a smaller opening. Look up the inside diameter in the manufacturer’s data for your pipe, or measure the bore across a cut end. Using the nominal size or the outside diameter will overstate the volume.
The formula
The inside circle has an area of 3.14159 times the radius squared. Multiply that by the length for the volume. Working in inches for the diameter and feet for the length:
Cubic feet = 3.14159 x (inside diameter in inches / 24)^2 x length in feet
Gallons = cubic feet x 7.480519
The divisor 24 turns a diameter in inches into a radius in feet. The factor 7.480519 comes from 1,728 cubic inches per cubic foot divided by 231 cubic inches per U.S. gallon. For liters, multiply cubic feet by 28.3168. The NIST conversion factors list the definitions of these units.
Worked examples
The pipe sizes below are illustrations.
4 inch inside diameter, 100 feet long. Radius is 2 inches, or 0.1667 feet. Volume = 3.14159 x 0.1667 x 0.1667 x 100 = 8.727 cubic feet. Times 7.480519 gives 65.28 gallons, or 247.1 liters. That is 0.653 gallons per foot.
2 inch inside diameter, 50 feet long. Volume = 1.091 cubic feet, which is 8.16 gallons.
6 inch inside diameter, 200 feet long. Volume = 39.270 cubic feet, which is 293.76 gallons.
Compare the first and third examples. The diameter is 1.5 times larger and the length is 2 times longer, yet the volume is more than four times greater. Volume grows with the square of the diameter, so a small change in bore size has a large effect on capacity.
Runs with several sizes and fittings
If a line changes size, calculate each section separately and add the gallons. For a curved run, use the length measured along the center of the pipe. Elbows, tees and valves add a small amount of volume. On a long straight run they hardly matter, but on a short run with many fittings it is worth adding a margin. A partly filled pipe holds only a fraction of the full figure.
Do it in Excel
Put the inside diameter in inches in A2 and the length in feet in B2.
Cubic feet: =PI()*(A2/24)^2*B2
Gallons: =PI()*(A2/24)^2*B2*7.480519
Liters: =PI()*(A2/24)^2*B2*28.3168
Gallons per foot: =PI()*(A2/24)^2*7.480519
What volume does not tell you
Capacity is not flow. How fast water moves through a pipe, and how much pressure it loses, depends on the flow rate, the pipe roughness, the length and the fittings. This calculation also uses a straight, round bore and does not account for scale or buildup on the inner wall. Water’s density is about 1 gram per milliliter per the USGS Water Science School, so you can estimate the weight of a full line from the liters. A gallon of water weighs a little over 8 pounds, which matters for hangers and supports.
Related tools
Use the pipe volume calculator for any diameter and length. For pools and bulk material, try the pool volume calculator and the cubic yard calculator.
Practical uses
Knowing the volume before you start also helps you buy the right amount of fluid, plan where drained water will go, and avoid surprises on the job site.
Plumbers use pipe volume to estimate how much water sits in a line before hot water arrives at a fixture, and how long a recirculation system takes to purge. Irrigation installers use it to size a drain-down or a blowout, and to check how much water will leave a line when it is opened at a low point. Fire protection and process piping crews use volume to plan test fills and flushing, since the water has to be supplied and disposed of.
When you are filling a line with a treatment chemical, the volume sets the dose. Multiply the gallons by the label’s dose per gallon, and remember to include any tank or equipment that is connected to the line. For a pressure test, the volume tells you how much water the test pump must add to bring the line up to pressure, which is a very small amount compared with the total. If the pump keeps adding water after the line is full, that is a sign of a leak.

Frequently asked questions
How do I calculate the volume of a pipe?
Find the area of the inside circle, multiply by the length, and convert to gallons. A 4 inch inside diameter pipe 100 feet long holds 65.28 gallons.
Should I use the nominal or the inside diameter?
Use the inside diameter. Nominal size is a label, and wall thickness changes the real bore.
How many gallons are in a cubic foot?
About 7.48 U.S. gallons, since a gallon is 231 cubic inches and a cubic foot is 1,728.
Does pipe volume include fittings?
No. Fittings and valves add a small extra volume that you can add by hand.


