Bioaccumulation of potentially toxic metals by litter-feeding invertebrates is determined not only by the concentration of metal in the diet, but also by the flux of food through the body. Nitrogen and phosphorus are the main elements regulating food consumption and so are expected to affect the bioaccumulation of trace elements such as cadmium. To test this idea, we applied a three-factor orthogonal experimental design to estimate the effects of nitrogen, phosphorus and cadmium additions to the food on cadmium accumulation by the terrestrial isopod Porcellio scaber. Cd, N and P were added to milled poplar litter in concentrations of 0, 10 and 20 μg g −1 for cadmium, 0, 0.875 and 1.75% for nitrogen and 0, 0.2 and 0.4% for phosphorus. Observations were made for daily food consumption (estimated from faecal pellet production) and weekly Cd accumulation over a period of 4 weeks. Dietary Cd decreased consumption in the first 2 weeks of the experiment, but this effect disappeared later. Phosphorus had a significant positive effect on consumption in the second and the third week of the experiment. Accumulation of Cd was determined mainly by the Cd concentration in the food, but the effect was stimulated by P and diminished by N additions. Analysis of the data by regression using response surfaces confirmed that N and P had opposite influences on both Cd accumulation and food consumption. The data underline the importance of measuring consumption and food quality when conducting bioaccumulation and ecotoxicity experiments with soil invertebrates exposed through the diet.