The trade-off made by pigs between exposure to a concentration of ammonia gas recorded in commercial piggeries and thermal comfort was observed in two chronic choice tests. In the first experiment, eight pigs which were paired and eight pigs which were held as singles, were forced to choose between compartments of a preference chamber that were polluted with an ammonia gas concentration of 40 p.p.m. and heated with a 750 W radiant heater or compartments that were unpolluted and unheated, for 8 days. The location of the choice options was switched after 4 days to eliminate positional bias. Air temperature ranged from 0·5 °C to 15·0 °C. In the second experiment, eight pigs held as pairs, were free to choose between compartments that were polluted with an ammonia gas concentration of 40 p.p.m. and heated with a 750 W radiant heater, polluted and unheated, unpolluted and heated and unpolluted and unheated, for 14 days. The location of the choice options was switched after 7 days to eliminate positional bias. Air temperature ranged from 4·0 °C to 24·0 °C. All compartments contained food and water ad libitum; wood shavings were used as bedding material. In both experiments, the location of all pigs was scan sampled every 15 min and their behaviour at this time was recorded instantaneously. Location and behaviour were compared against air temperature. In the first, forced choice experiment, the pigs preferred the heated-polluted compartments when air temperature was less than the estimated lower critical temperature (LCT) (P < 0·001). As air temperature approached the estimated LCT, the pigs occupied the unheated-unpolluted compartments more often. Overall each visit made to the heated-polluted compartments lasted significantly longer at 265 min (paired), 208 min (single) than visits to the unheated-unpolluted compartments at 29 min (paired), 31 min (single) (P < 0·001). Although they could have huddled to conserve heat, the paired pigs spent less time, overall, in the unheated-unpolluted compartments (P < 0·001). When air temperatures were lower than the estimated LCT, the pigs huddled together but as air temperature increased, the pigs spent more time resting apart (P < 0·001) in the heated-polluted compartments. It is suggested that the paired pigs were motivated to remain in the heated-polluted compartments for companionship rather than thermal comfort. In the second, free choice experiment, the pigs preferred to remain in the unpolluted compartments, adjusting their occupancy of the heated and unheated compartments as ambient air temperature decreased or increased above the estimated LCT (P < 0·001). The pigs made fewer visits to the polluted compartments and each visit was shorter, at 44 min (P < 0·001). Visits to the unpolluted compartments lasted for 291 min. It is suggested that the delayed aversion shown to ammonia in both experiments was due to a progressive sense of malaise. However, both experiments indicated that this delayed ammonia aversion was weaker than preference for thermal comfort.