Background: A better understanding of the environmental factors that contribute to obesity is imperative if any therapeutic effect on the increasing prevalence of overweight and obesity in the United States is to be achieved. Objective: This study examined the effect of the interaction of diet composition and physical inactivity on energy and fat balances. Design: Thirty-five normal-weight and obese subjects were randomly assigned to either a 15-d isoenergetic high-carbohydrate (HC) or high-fat (HF) diet according to a crossover design. During the first 14 d, body weight and physical activity were maintained. On day 15, subjects spent 23 h in a whole-room indirect calorimeter and were fed a diet similar to that consumed during the previous 7 d while remaining physically inactive. Results: Energy intakes required to maintain body weight stability during the first 14 d were similar between diets. Normal-weight and obese subjects consuming both diets had a positive energy balance on the sedentary day (day 15), suggesting that subjects were less active in the calorimeter. There was no significant effect of diet composition on total energy balance and total protein-energy balance on day 15; however, carbohydrate balance was more positive with the HC (2497.8 ± 301.2 kJ) than with the HF (1159 ± 301.2 kJ) diet (P = 0.0032). Most importantly, fat balance was more positive with the HF (1790.8 ± 510.4 kJ) than with the HC (-62.8 ± 510.4 kJ) diet (P = 0.0011). Conclusion: Chronic consumption of a high-carbohydrate diet could provide some protection against body fat accumulation in persons with a pattern of physical activity that includes frequent sedentary days.