Birds of marine environments have specialized glands to excrete salt, the saltglands. Located on the skull between the eyes, the size of these organs is expected to reflect their demand, which will vary with water turnover rates as a function of environmental (heat load, salinity of prey and drinking water) and organismal (energy demand, physiological state) factors. On the basis of inter- and intraspecific comparisons of saltgland mass (m sg) in 29 species of shorebird (suborder Charadrii) from saline, fresh and mixed water habitats, we assessed the relative roles of organism and environment in determining measured m sg species. The allometric exponent, scaling dry m sg to shorebird total body mass (m b), was significantly higher for coastal marine species (0??88, N=19) than for nonmarine species (0??43, N=14). Within the marine species, those ingesting bivalves intact had significantly higher m sg than species eating soft-bodied invertebrates, indicating that seawater contained within the shells added to the salt load. In red knots (Calidris canutus), dry m sg varied with monthly averaged ambient temperature in a U-shaped way, with the lowest mass at 12??5??C. This probably reflects increased energy demand for thermoregulation at low temperatures and elevated respiratory water loss at high temperatures. In fuelling bar-tailed godwits (Limosa lapponica), dry m sg was positively correlated with intestine mass, an indicator of relative food intake rates. These findings suggest once more that saltgland masses vary within species (and presumably individuals) in relation to salt load, that is a function of energy turnover (thermoregulation and fuelling) and evaporative water needs. Our results support the notion that m sg is strongly influenced by habitat salinity, and also by factors influencing salt load and demand for osmotically free water including ambient temperature, prey type and energy intake rates. Saltglands are evidently highly flexible organs. The small size of saltglands when demands are low suggests that any time costs of adjustment are lower than the costs of maintaining a larger size in this small but essential piece of metabolic machinery. ?? 2011 The Authors. Functional Ecology ?? 2011 British Ecological Society.