# Recipe cost calculator

- Human page: https://happytails.ai/en/calculators/recipe-cost-calculator/
- Markdown: https://happytails.ai/en/calculators/recipe-cost-calculator.md
- Structured JSON: https://happytails.ai/agents/en/calculators/recipe-cost-calculator/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `recipe-cost-calculator` |
| Category | calculators |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Enter package prices and the quantities used in one currency. Use a decimal point, no currency symbols or thousands separators. Units: kg, g, mg, lb, oz, L, mL, US gallon, Imperial gallon, US fl oz, item. Do not mix mass, volume and item counts within an ingredient. Up to 200 ingredients. Costs are calculated exactly, then rounded half up. Any line-rounding difference is shown separately. Currency is a label; no exchange rates, taxes, labour or waste allowance are added. Your input stays on your device.

### Inputs and settings

Text input: Ingredient prices and quantities.

Example or placeholder shown in the interface (not a validated fixture):

```text
ingredient,pack_price,pack_quantity,pack_unit,used_quantity,used_unit
Flour,2.40,1,kg,300,g
Milk,1.20,1,L,250,mL
Eggs,3.60,12,item,2,item
```

Use the six CSV headers in the example. Quote ingredient names containing commas. Keep the unit codes unchanged and use a decimal point. Up to 120,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `servings` | Servings | text | "4" |  |
| `currency` | Currency code | text | "USD" |  |
| `precision` | Currency decimal places | select | "2" | Allowed: 0, 2, 3, 4 |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

Use 1 to 200 ingredients, up to 120,000 characters. Prices and quantities must be nonnegative plain decimals, with at most six decimal places and values no greater than 1,000,000,000. Package quantities and servings must be positive; servings may be fractional and no greater than 1,000,000. Use one currency throughout. Prices do not include added tax, labour, overhead or waste. Costs use exact fractions before half-up rounding at your chosen currency precision. All processing stays on your device.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "recipe-cost-calculator",
  "category": "calculators",
  "built": true,
  "requirements": "Use 1 to 200 ingredients, up to 120,000 characters. Prices and quantities must be nonnegative plain decimals, with at most six decimal places and values no greater than 1,000,000,000. Package quantities and servings must be positive; servings may be fractional and no greater than 1,000,000. Use one currency throughout. Prices do not include added tax, labour, overhead or waste. Costs use exact fractions before half-up rounding at your chosen currency precision. All processing stays on your device.",
  "implementation": {
    "fields": [
      {
        "key": "servings",
        "label": "Servings",
        "value": "4",
        "type": "text",
        "inputMode": "decimal"
      },
      {
        "key": "currency",
        "label": "Currency code",
        "value": "USD",
        "type": "text"
      },
      {
        "key": "precision",
        "label": "Currency decimal places",
        "value": "2",
        "type": "select",
        "values": [
          "0",
          "2",
          "3",
          "4"
        ]
      }
    ],
    "presentation": "metrics",
    "inputMaxLength": 120000,
    "inputErrorCode": "RECIPE_SIZE",
    "note": "Enter package prices and the quantities used in one currency. Use a decimal point, no currency symbols or thousands separators. Units: kg, g, mg, lb, oz, L, mL, US gallon, Imperial gallon, US fl oz, item. Do not mix mass, volume and item counts within an ingredient. Up to 200 ingredients. Costs are calculated exactly, then rounded half up. Any line-rounding difference is shown separately. Currency is a label; no exchange rates, taxes, labour or waste allowance are added. Your input stays on your device.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 120000,
      "inputMode": "text",
      "label": "Ingredient prices and quantities",
      "placeholder": "ingredient,pack_price,pack_quantity,pack_unit,used_quantity,used_unit\nFlour,2.40,1,kg,300,g\nMilk,1.20,1,L,250,mL\nEggs,3.60,12,item,2,item",
      "help": "Use the six CSV headers in the example. Quote ingredient names containing commas. Keep the unit codes unchanged and use a decimal point. Up to 120,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Work out what each ingredient costs in your recipe, then see the total and cost per serving. Compare pack sizes without uploading your prices.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

### How to use Recipe cost calculator

1. Enter one CSV row per ingredient, using the headers and unit codes in the example.
2. Set the recipe servings, currency code and number of decimal places. Calculate and check the ingredient breakdown.
3. Download complete JSON, the ingredient CSV or the recipe summary CSV.

## Useful next steps

- [Recipe scaler](https://happytails.ai/en/calculators/recipe-scaler/) ([Markdown](https://happytails.ai/en/calculators/recipe-scaler.md))

- [Unit price calculator](https://happytails.ai/en/business-tools/unit-price-calculator/) ([Markdown](https://happytails.ai/en/business-tools/unit-price-calculator.md))

- [Food waste cost calculator](https://happytails.ai/en/calculators/food-waste-cost-calculator/) ([Markdown](https://happytails.ai/en/calculators/food-waste-cost-calculator.md))

## Pay for the amount you actually use

A 1 kg bag of flour costing 2.40 contributes 0.72 when you use 300 g. A 1 L carton costing 1.20 contributes 0.30 when you use 250 mL. Two eggs from a pack of twelve costing 3.60 add 0.60. The recipe costs 1.62 in total, or 0.41 per serving for four servings after rounding.

### Keep your units compatible

Use kg, g, mg, lb or oz for mass; L, mL, US gallon, Imperial gallon or US fl oz for volume; and item for counts. US gallon and Imperial gallon are different measures. This calculator does not convert a volume of flour into its weight or guess ingredient density.

### A clear rounding trail

Ingredient costs are added as exact fractions before the total is rounded. Rounded ingredient rows may differ from that total by a small amount. The displayed rounding adjustment reconciles them. The per-serving amount is calculated from the exact total, so multiplying rounded servings can also differ slightly.
