Previous studies have suggested that most small Australian elapid snakes are nocturnal and rarely bask in the open because of the risk of predation by diurnal predatory birds. Because the physiology and behaviour of reptiles is temperature dependent, staying in refuges by day can entail high thermoregulatory costs, particularly for juveniles that must grow rapidly to maximise their chances of survival. We investigated whether the risk of predation deters juveniles of the endangered broad-headed snake (Hoplocephalus bungaroides) from basking, and if so, whether there are thermal costs associated with refuge use. To estimate avian attack rates on snakes, we placed 900 plasticine snake replicas in sunny locations and underneath small stones on three sandstone plateaus for 72 h. At the same time we quantified the thermal benefits of basking vs refuge use. On sunny days, juveniles could maintain preferred body temperatures for 4.7 h by basking but only for 2.0 h if they remained inside refuges. Our predation experiment showed that basking has high costs for juvenile snakes. Predators attacked a significantly higher proportion of exposed models (13.3%) than models under rocks (1.6%). Birds were the major predators of exposed models (75% of attacks), and avian predation did not vary across the landscape. By trading heat for safety, juvenile H. bungaroides decreased the potential time period that they could maintain preferred body temperatures by 57%. Thermal costs of refuge use may therefore contribute to the slow growth and late maturation of this endangered species. Our results support the hypothesis that nocturnal activity in elapid snakes has evolved to minimise the risk of avian predation.