How do you convert grams to kilojoules?

the atwater conversion factors: 1 gram of fat = 37.7kj

1 gram of protein = 16.7kj

1 gram of carbohydrate = 16.7kj

1 gram of alcohol = 29.3kj