Calories are just a measure of heat energy, so the caloric content of your food is really just how hot/long a standard mass of food can burn.
So how do you measure that? You put a piece of it in a device called a [“bomb calorimeter”](https://study.com/academy/lesson/bomb-calorimeter-definition-equation-example.html) and then heat it up and measure how much energy it outputs – literally just “this piece of cake burns hotter than an equally-sized piece of potato”.
Latest Answers