How it's calculated
V = π × r² × L, r = inner diameter ÷ 2
r = inner radius, L = pipe length (consistent units → m³). US gallons = m³ × 264.172; litres = m³ × 1000.
Common questions
Should I use inner or outer diameter?
Use the inner diameter. The wall thickness does not hold water, so the bore is what matters for volume.
What is the formula for pipe volume?
It is pi times the radius squared times the length. The radius is half the inner diameter.