πŸ› οΈToolsShed

Cooking Unit Converter

Convert between cups, tablespoons, teaspoons, milliliters, grams, and ounces for cooking.

Cooking Converter helps home cooks and professional chefs convert between the measurement units used in recipes from different countries. It handles volume measures (cups, tablespoons, teaspoons, milliliters, fluid ounces), weight measures (grams, ounces, pounds), and common ingredient-specific conversions such as cups of flour or sugar to grams.

Enter any cooking measurement and instantly see its equivalent in the units you need. This is particularly helpful when following recipes written in American measurements (cups, sticks of butter) and converting them to the metric system used in most of the world, or vice versa.

One common stumbling block is that volumetric measurements like a "cup" of flour can represent different weights depending on how the flour is packed. This tool provides standardized conversions for common pantry ingredients to help you achieve consistent results.

Frequently Asked Questions

Code Implementation

# Cooking unit conversion in Python
UNITS_ML = {
    "tsp":   4.92892,   # US teaspoon
    "tbsp":  14.7868,   # US tablespoon
    "fl_oz": 29.5735,   # US fluid ounce
    "cup":   236.588,   # US cup
    "pint":  473.176,   # US pint
    "quart": 946.353,   # US quart
    "liter": 1000.0,
    "ml":    1.0,
}

def convert_cooking(value: float, from_unit: str, to_unit: str) -> float:
    ml = value * UNITS_ML[from_unit]
    return ml / UNITS_ML[to_unit]

# Examples
print(convert_cooking(1, "cup", "ml"))     # 236.588
print(convert_cooking(3, "tsp", "tbsp"))   # 1.0
print(convert_cooking(2, "cup", "liter"))  # 0.473176
print(convert_cooking(500, "ml", "cup"))   # 2.113...

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.