Converts a volume between metric units and US customary or UK imperial volume units.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
value (number, from_unit, required) : The volume to convert
from_unit (string, required) one of: mL, L, tsp, tbsp, fl_oz_us, cup_us, pint_us, quart_us, gallon_us, gallon_uk : Unit of the input value
to_unit (string, required) one of: mL, L, tsp, tbsp, fl_oz_us, cup_us, pint_us, quart_us, gallon_us, gallon_uk : Unit to convert into
Outputs
result (to_unit): The converted volume
Steps
Look up the exact liter-equivalent of from_unit and of to_unit from the US customary / UK table.
Convert the input to liters: liters = value * liters_per(from_unit).
Convert liters to the target unit: result = liters / liters_per(to_unit).
Round result to 6 significant figures.
Constants
mL = 0.001 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
L = 1 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
tsp = 0.00492892159375 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
tbsp = 0.01478676478125 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
fl_oz_us = 0.0295735295625 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
cup_us = 0.2365882365 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
pint_us = 0.473176473 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
quart_us = 0.946352946 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
gallon_us = 3.785411784 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
gallon_uk = 4.54609 L (source: Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices)
Sources
Specifications, Tolerances, and Other Technical Requirements for Weighing and Measuring Devices (National Institute of Standards and Technology, 2026-09-30T19:29:48Z) - US customary units (tsp, tbsp, fl oz, cup, pint, quart, gallon) defined exactly from the US gallon = 3.785411784 L; the UK (imperial) gallon = 4.54609 L exactly per the Weights and Measures Act definition.