The effects of ambient temperature (T; 12–29°C), body weight (BW; 30–90 kg) and metabolisable energy intake (ME) on components of energy balance were studied in seven groups of Piétrain × Large White barrows kept in a respiratory chamber. In Expt 1 (groups 1, 2 and 3), T varied in a cyclic way from 22°C to 12°C and then from 12°C to 22°C with three or four consecutive days at each of 22, 19, 16, 14 and 12°C. Similarly, in Expt 2 (groups 4, 5 and 6), T varied from 19 to 29°C and then from 29 to 19°C with three or four consecutive days at each of 19, 22, 25, 27 and 29°C. In both experiments, pigs were offered feed ad libitum. In Expt 3, pigs (group 7) were exposed to the thermic conditions of Expt 1 but their feed allowance was adjusted on a BW basis to the ad libitum intake recorded at 19 and 22°C in Expt 1. Groups 1, 2, 4, 5 and 7 were used over two successive cycles with initial average BW of 37 kg at cycle 1 (four pigs per group) and 63 kg at cycle 2 (three pigs per group). Groups 3 and 6 were studied at an intermediary stage of growth; their initial BW was 45 kg. The O2 and CO2 concentrations, physical activity and feed intake were continuously and simultaneously measured and used to calculate total heat production (HP; HPtot), HP due to physical activity (HPact), activity-free HP (HP0), and thermic effect of feed. HP was modelled as a non-linear function with T, BW and ME as predictors. Results indicate that all components of HP were proportional to BW0·60. Physical activity was minimal between 19 and 27°C (8 % ME). The estimated lower critical temperature was 24°C. Between 24 and 12°C, total thermic effect of feed decreased from 31 to 16 % ME, but the short-term thermic effect of feed (5·1 % ME) remained constant. Equations for prediction of HPtot, HPact and HP0 according to BW, T and ME are proposed and evaluated according to literature values; values for the feed cost of thermoregulation in pigs are proposed.