Protein and carbohydrates each contain 4 calories per gram. Consuming the right balance of protein, carbohydrates and fat can help you maintain a healthy weight and optimize your energy levels. Protein and carbohydrates both contain 4 calories per gram, while fat provides 9 calories per gram. Calculating your calorie needs can help you determine how many grams of protein, carbohydrates and fat you should consume each day.