{
  "id": "recipe-calorie",
  "version": "46c29187ccad",
  "status": "published",
  "name": "Recipe Calorie Calculator",
  "question": "What are my recipe calories?",
  "summary": "Adds up the calories of a recipe’s ingredients, from USDA SR Legacy values or values from a label, and divides by the number of servings, with the weight per serving.",
  "category": "food",
  "subcategory": "cooking",
  "url": "https://www.acalculator.org/food/recipe-calorie-calculator",
  "markdown": "https://www.acalculator.org/food/recipe-calorie-calculator.md",
  "kind": "function",
  "method": "calories = Σ (kcal per 100 g × grams ÷ 100) over the ingredients; per serving = calories ÷ servings; grams = portions × portion weight, or the weight in g, oz, lb or kg.",
  "assumptions": [
    "Energy values and portion weights are from USDA SR Legacy (April 2018) for 154 common foods; a value typed from a label replaces the table value.",
    "Ingredients are weighed as listed (raw unless the food says cooked). Cooking changes the weight, mostly water, but not the calories, so the calories are for the whole dish.",
    "Servings are equal shares of the whole dish.",
    "Calories are kilocalories (the Calories on a food label); 1 kcal = 4.184 kJ."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "servings": {
        "title": "Servings",
        "description": "How many servings the recipe makes.",
        "type": "number",
        "minimum": 0.1,
        "maximum": 1000
      },
      "items": {
        "title": "Ingredients",
        "description": "One row per ingredient: the food, the amount, and its unit.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "f": {
              "title": "Ingredient",
              "description": "The food from the USDA list, or Other to type its calories per 100 g.",
              "type": "string",
              "enum": [
                "9003",
                "9040",
                "9200",
                "9316",
                "9132",
                "9050",
                "9326",
                "9266",
                "9176",
                "9236",
                "9252",
                "9037",
                "9070",
                "9148",
                "9298",
                "9206",
                "9016",
                "11090",
                "11124",
                "11674",
                "11508",
                "11529",
                "11252",
                "11457",
                "11205",
                "11282",
                "11167",
                "11304",
                "11333",
                "11260",
                "11135",
                "11143",
                "11109",
                "11233",
                "11477",
                "11052",
                "11011",
                "11212",
                "20045",
                "20037",
                "20121",
                "20310",
                "20137",
                "20029",
                "8120",
                "8013",
                "8037",
                "18069",
                "18075",
                "18060",
                "18001",
                "18437",
                "18350",
                "18364",
                "18363",
                "18239",
                "18228",
                "18293",
                "18367",
                "18250",
                "18159",
                "18301",
                "18101",
                "1077",
                "1079",
                "1085",
                "1009",
                "1026",
                "1032",
                "1040",
                "1019",
                "1017",
                "1016",
                "1116",
                "1256",
                "1001",
                "1053",
                "1049",
                "1123",
                "1129",
                "1128",
                "1132",
                "5064",
                "5098",
                "5069",
                "5106",
                "5220",
                "23570",
                "13455",
                "10216",
                "10862",
                "7029",
                "7081",
                "7945",
                "7064",
                "7071",
                "17022",
                "15237",
                "15121",
                "15016",
                "15271",
                "15262",
                "15088",
                "15140",
                "16015",
                "16057",
                "16070",
                "16033",
                "16426",
                "16158",
                "16167",
                "16390",
                "12061",
                "12155",
                "12085",
                "12152",
                "12037",
                "12006",
                "4053",
                "4582",
                "4025",
                "19335",
                "19296",
                "19353",
                "19297",
                "19120",
                "19904",
                "19095",
                "11935",
                "6164",
                "19411",
                "19056",
                "19034",
                "19047",
                "19015",
                "21224",
                "21107",
                "21089",
                "21469",
                "21082",
                "21060",
                "21130",
                "22970",
                "14148",
                "14144",
                "14209",
                "14355",
                "14003",
                "14096",
                "14106",
                "14037",
                "14091",
                "16120",
                "14555",
                "other"
              ]
            },
            "q": {
              "title": "Amount",
              "description": "How much of the ingredient goes in the recipe.",
              "type": "number",
              "minimum": 0,
              "maximum": 100000
            },
            "u": {
              "title": "Unit",
              "description": "Household portions of the food (as listed), grams, ounces, pounds, or kilograms.",
              "type": "string",
              "enum": [
                "portion",
                "g",
                "oz",
                "lb",
                "kg"
              ]
            },
            "k": {
              "title": "Calories per 100 g (optional)",
              "description": "From a food label: replaces the USDA value; needed for Other.",
              "type": "number",
              "minimum": 0,
              "maximum": 900
            }
          }
        }
      }
    }
  },
  "outputs": {
    "perServing": {
      "label": "Calories per serving",
      "description": "Total calories ÷ servings, in kcal (the Calories on a food label).",
      "format": "number"
    },
    "total": {
      "label": "Calories in the whole recipe",
      "description": "The sum over the ingredients of kcal per 100 g × grams ÷ 100.",
      "format": "number"
    },
    "kjPerServing": {
      "label": "Energy per serving in kilojoules",
      "description": "Calories per serving × 4.184.",
      "format": "number"
    },
    "grams": {
      "label": "Weight of the ingredients",
      "description": "All the ingredients’ grams added up, before cooking.",
      "format": "number"
    },
    "gramsPerServing": {
      "label": "Ingredient weight per serving",
      "description": "The ingredients’ weight ÷ servings, before cooking.",
      "format": "number"
    },
    "per100": {
      "label": "Calories per 100 g of ingredients",
      "description": "Total calories × 100 ÷ the ingredients’ weight.",
      "format": "number"
    },
    "breakdown": {
      "label": "Calories by ingredient",
      "description": "Each ingredient’s grams and calories, rounded half up to whole numbers.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "servings": 10,
      "items": [
        {
          "food": "9040",
          "amount": 3,
          "unit": "portion"
        },
        {
          "food": "1123",
          "amount": 2,
          "unit": "portion"
        },
        {
          "food": "1001",
          "amount": 113,
          "unit": "g"
        },
        {
          "food": "19335",
          "amount": 150,
          "unit": "g"
        },
        {
          "food": "other",
          "amount": 250,
          "unit": "g",
          "kcal": 364
        }
      ]
    },
    "outputs": {
      "perServing": 275.877,
      "total": 2758.77,
      "kjPerServing": 1154.269368,
      "grams": 967,
      "gramsPerServing": 96.7,
      "per100": 285.29162357807655,
      "breakdown": "Banana, raw: 354 g, 315 kcal; Egg, raw: 100 g, 143 kcal; Butter, salted: 113 g, 810 kcal; Sugar, granulated: 150 g, 581 kcal; Other: 250 g, 910 kcal"
    },
    "text": "The recipe has about 2,759 calories, or 276 per serving."
  },
  "examples": [
    {
      "given": {
        "items": [
          {
            "food": "9040",
            "amount": 3,
            "unit": "portion"
          },
          {
            "food": "1123",
            "amount": 2,
            "unit": "portion"
          },
          {
            "food": "1001",
            "amount": 113,
            "unit": "g"
          },
          {
            "food": "19335",
            "amount": 150,
            "unit": "g"
          },
          {
            "food": "other",
            "amount": 250,
            "unit": "g",
            "kcal": 364
          }
        ],
        "servings": 10
      },
      "expect": {
        "total": 2758.77,
        "perServing": 275.877,
        "grams": 967,
        "per100": 285.29162357807655,
        "kjPerServing": 1154.269368
      },
      "source": "USDA FoodData Central, SR Legacy: 09040 Bananas, raw 89 kcal per 100 g, 1 medium = 118 g; 01123 Egg, whole, raw 143 kcal, 1 large = 50 g; 01001 Butter, salted 717 kcal; 19335 Sugars, granulated 387 kcal (https://fdc.nal.usda.gov/, retrieved 2026-09-30); hand calculation in content.mdx: 315.06 + 143 + 810.21 + 580.5 + 910 = 2,758.77"
    },
    {
      "given": {
        "items": [
          {
            "food": "20045",
            "amount": 2,
            "unit": "portion"
          },
          {
            "food": "5064",
            "amount": 8,
            "unit": "oz"
          }
        ],
        "servings": 2
      },
      "expect": {
        "total": 785.01370525,
        "perServing": 392.506852625,
        "grams": 542.796185,
        "per100": 144.62402775546406
      },
      "source": "USDA FoodData Central, SR Legacy: 20045 Rice, white, long-grain, cooked 130 kcal per 100 g, 1 cup = 158 g; 05064 Chicken, broilers or fryers, breast, meat only, roasted 165 kcal (https://fdc.nal.usda.gov/); NIST SP 811: 1 oz = 28.349523125 g; hand calculation in content.mdx",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "U.S. Department of Agriculture, Agricultural Research Service. FoodData Central: SR Legacy, April 2018 (energy, kcal per 100 g; household portion weights), public domain, retrieved 2026-09-30. https://fdc.nal.usda.gov/",
    "U.S. Food and Drug Administration, How to Understand and Use the Nutrition Facts Label, retrieved 2026-10-01. https://www.fda.gov/food/nutrition-facts-label/how-understand-and-use-nutrition-facts-label",
    "NIST Special Publication 811, Appendix B (1 oz = 28.349523125 g, 1 lb = 453.59237 g, thermochemical calorie = 4.184 J). https://www.nist.gov/pml/special-publication-811"
  ],
  "related": [
    "food-calorie",
    "calorie",
    "abv"
  ],
  "changelog": []
}
