The calories in homebrew come from alcohol and carbohydrates. Brewgr uses the following calculation to determine the amount of calories that will be in your homebrew.
Calories From Alcohol = 1881.22 * FG * (OG - FG) / (1.775 - OG)
Calories From Carbs = 3550.0 * FG * ((0.1808 * OG) + (0.8192 * FG) - 1.0004)
Total Calories = Calories From Alcohol + Calories From Carbs