Prior to the present study little was known about factors that control daily, seasonal, or ontogenetic changes in the vertical distribution of Pacific cod Gadus macrocephalus, an ecologically and commercially important fish species in the northern Pacific Ocean. Vertical distribution and migration of species in the family Gadidae are primarily controlled by gradients of light, temperature, food, and predators. The role of these factors in the vertical distribution of juvenile Pacific cod (0+ and 1+ yr) was tested by exposing fish to vertical gradients of light, temperature, and food that were constructed in the laboratory to simulate conditions normally found in Pacific cod habitats. Fish avoided high light and cold water. Food introduction in warm isothermal water (9°C) induced fish to feed and form more groups than when food was not present. In cold-thermocline conditions (9 to 3°C, top to bottom), food introduction into the lower third of the tank induced fish to swim deeper, but detections of food, feeding, and the formation of groups were initially inhibited by excursions into cold water. Increasing consumption of food during the hour after feeding indicated that fish adapted to cold water. Fish adapted within an hour of continuous exposure to high light as they swam higher in the water column. The effects of fish age were minor and evident as interactions with environmental condition effects on the number of fish groups. Pacific cod are able to adapt to changing ecological conditions, and their behavioural flexibility in response to food, temperature, and light conditions make prediction of vertical distribution complex. Future field studies of the diel vertical migration of Pacific cod should include concurrent measurements of key environmental factors and consider the ability for fish to quickly adapt to changing conditions.