Calorie Testing

How do companies test for protein, fat, carbohydrate, and calorie content of food? Is the technology available for the average joe to test their own food, as well? I’ve always been curious about this


bomb calorimetry.
then fat, protein and carbs get calculated in grams.

Anything left-over as differenec between bomb calorimetry and weighing is attributed to carbs if not identifiable.

Universities and nutrition labs in cities offer such services.

so this wouldn’t be something I could do at my house, I presume?