A p r 2 where r is the radius which is equal to d2. First measure the diameter of the base usually easier than measuring the radius then measure the height of the cylinder. A cylinder has circular faces at each end and a curved face.
For a pipe use its length instead of height.
The Gallons in a Cylinder calculator computes the volume of a right circular cylinder in gallons from the height h and radius r of the base see diagram. The formula I have is. OR US gallons volume results. A p r 2 where r is the radius which is equal to d2.