We examined habitat preferences of 106 radio-marked Western Sandpipers (Calidris mauri) in the San Francisco Bay estuary during winter and spring at two scales: comparing proportions of habitats in their home range with habitats available in the study area (second-order selection), and comparing proportions of radio locations in different habitats with their availability in the home range (third-order selection). Daily and seasonal habitat preferences differed significantly as habitat availability changed temporally. Under second-order selection, Western Sandpipers preferred tidal sloughs and mud flats on winter low tides, and salt-pond levees at high tides. They preferred salt-pond levees and mud flats at low tides, and salt-pond levees at high tides under third-order selection. During the spring, their preferred habitats were drained and tidal salt ponds, and seasonal wetlands at high tide. At low tide, their preferred habitats were tidal sloughs and tidal salt ponds. Salt-marsh plains were the least preferred habitats during both seasons. Adults were more selective than juveniles in use of low tide habitats, but salt-pond levees were the most preferred habitats for both. Habitat preferences varied considerably when different estimates of habitat availability and use were used. If mud-flat habitats were measured as linear foraging areas along the tide line, the preference for those habitats increased from second to first. When second-order selection was estimated from radio locations rather than home ranges, the resulting composition was similar to third-order selection. Our results suggest that regional conservation plans that restore salt marshes for the benefit of endangered species must consider the effects of losing artificial salt-pond habitats, which are locally important for sandpipers.