A U.S. gallon of water displaces 231 cubic inches (Queen Anne's Gallon). If you can find a perfectly or near perfectly cylindrical vessel (e.g., a kettle), you can calculate volume in gallons and fractions of a gallon using the following formula:

volume_of_cylinder_in_gallons = 3.14 x radius x radius x height_of_the_liquid_column / 231

Example:

My Vollrath 6-gallon Tri-Ply kettle is 12" wide (diameter) x 12.5" high (height). Radius is half the diameter; hence, the radius of this kettle is 6". I usually boil down to approximately (~) 8" of liquid in this kettle. The volume of a liquid increases roughly 5% at 100C (212F). What is the volume of wort + break + hops in the kettle?

volume_at_100C = 3.14 x 6 x 6 x 8 / 231 = ~3.92 gallons

volume_at_room_temperature = 3.92 x 0.95 = ~3.72 gallons

The formula shown above will not work with a bucket because it is actually a modified cone. This type of geometric shape is known as a conical frustum.

volume_of_a_conical_frustrum_in_gallons = 3.14 x height x (radius_1 + radius_2 + (radius_1 * radius_2)) / 3 / 231

Where radius_1 = internal diameter (width) of the bucket at the bottom / 2, and radius_2 = internal diameter of the bucket at the top of the liquid column / 2