Back to methodology
Onboarding calculation
Macro Target Methodology
How onboarding converts calories and lean mass into protein, fat, carbohydrate, sugar, and saturated-fat targets.
Status: Used in the final target summary and meal-plan target matching.
Last updated: June 15, 2026
Inputs and outputs
Inputs
- Final calorie target
- Lean mass
- Goal
- Diet preference
Outputs
- Protein grams per day
- Fat grams per day
- Carbohydrate grams per day
- Saturated-fat ceiling
- Sugar ceiling
Formula
main_protein_g = round(lean_mass_kg * (goal == gain ? 2.3 : 2.2))
main_fat_g = round((target_calories * 0.35) / 9)
main_carbs_g = max(0, round((target_calories - main_protein_g * 4 - main_fat_g * 9) / 4))
legacy standard split = protein 15%, fat 30%, carbs 55%
legacy keto split = protein 25%, fat 70%, carbs 5%
legacy vegan split = protein 20%, fat 30%, carbs 50%
saturated_fat_ceiling_g = round((target_calories * 0.06) / 9)
sugar_ceiling_g = round((target_calories * 0.10) / 4)
Calculation steps
- Use lean mass, not total weight, for the main protein target.
- Set the main fat target at 35% of calories.
- Assign remaining calories to carbohydrates after protein and fat are allocated.
- Keep legacy diet splits available for the older plan-macro summary.
- Set conservative sugar and saturated-fat ceilings from calorie percentage limits.
Guardrails
- Very high protein is not presented as automatically better.
- Carbohydrates are never allowed to go below zero in the calculation.
- Sugar and saturated-fat ceilings are limits, not targets to reach.
Sources
These formulas describe how Unflame estimates onboarding targets. They are planning estimates and should be reviewed against real-world trends, user preference, symptoms, and professional guidance where relevant.