Macro calculator
Search foods, enter the grams and see the calories, protein, carbs and fat of your meal. The data comes from a public USDA database and is shown per 100 g and per serving.
Macro calculator
Privacy: what you type (age, weight, height, meals, recipes) stays in your browser and is not sent to any server. We only count, anonymously and without cookies, what is searched for and which options are chosen (for example “goku” in the character search) to improve the tools. To remember your ticks and your data, this page uses your device’s local storage. You can delete it whenever you like. What is stored and how to delete it
How it works and where the data comes from
How to use it
Search for a food or pick a group and select it to add it to the list. Change the amount in grams or choose a serving. The summary at the top adds up energy, protein, carbs and fat instantly;
Your meals and targets never leave your device: the tool runs in your browser and only keeps your last meal and your daily target in local storage. We only count, anonymously, which foods are searched for and added, to improve the database.
Where the data comes from
Values come from USDA FoodData Central, SR Legacy version (April 2018), per 100 g of edible portion. There are 258 selected foods. Each one says whether it is raw or cooked and links its FDC code. Servings only appear when the USDA publishes their weight in grams.[1]
These are laboratory averages for generic foods. The label of a specific product overrides these values. There is no demo data: every value comes from that source.
How it is calculated: a worked example
Each food is scaled by its grams from its value per 100 g, and then they are added up. With the example breakfast “Creamy oats with banana and walnuts”:
| Food | Weight | kcal | Protein (g) | Carbs (g) | Fat (g) |
|---|---|---|---|---|---|
| Rolled oats (dry) | 50 g | 190 | 6.6 | 33.9 | 3.3 |
| Reduced-fat milk (2%) | 200 g | 100 | 6.6 | 9.6 | 4.0 |
| Banana (raw) | 118 g | 105 | 1.3 | 27.0 | 0.4 |
| Walnuts | 15 g | 98 | 2.3 | 2.1 | 9.8 |
| Total | 493 | 16.8 | 72.6 | 17.5 |
The energy split uses 4 kcal per gram of protein and carbs and 9 per gram of fat: protein 16.8 × 4 ≈ 67 kcal, carbs 72.6 × 4 ≈ 290 kcal and fat 17.5 × 9 ≈ 158 kcal. In total, 67 + 290 + 158 = 515 kcal: 13% protein, 56% carbs and 31% fat.[1]
That sum (515 kcal) does not match the calories in the table (493 kcal): USDA uses its own factors for each food, and fibre counts too. That is why the percentages are worked out from the sum of the three macros while the calories come from the table.
Frequently asked questions
Why does it not match my product’s label?
Raw or cooked?
Are my meals saved?
More tools
Sources (1)
- U.S. Department of Agriculture, Agricultural Research Service. “FoodData Central, SR Legacy (April 2018)”. Accessed October 16, 2026. fdc.nal.usda.gov/
Date this page was reviewed: October 17, 2026. If you spot a mistake, tell us here. What we fix is listed in the corrections log.