Performance and body composition of insect larvae depend on quality and quantity of their diet, and on biotic factors such as larval density. We investigated the effect of dietary nutrient concentration and larval rearing density on survival, development, growth, and protein and fat contents of larvae of the black soldier fly (BSF), Hermetia illucens L. (Diptera: Stratiomyidae). Neonate larvae were fed with a low (NC1), intermediate (NC2), or high nutrient concentration (NC3), and with four rearing densities (50, 100, 200, or 400 larvae per container). Two feeding regimes (FR) were tested: in FR1, the amount of diet added during the experiment was based on the visually estimated larval mass present, whereas in FR2, a fixed feeding ration of 0.6 g of food per larva was applied at the start. FR1 resulted in food limitation, resulting in significantly lower body crude protein content on diet NC1 than on NC2 at larval densities 100 and 200. Larval crude fat content was higher on diets with higher nutrient concentration and at lower larval densities. For FR2, development time was shorter on diets with higher nutrient concentration and at lower larval densities. Individual larval weight and total larval yield increased with higher nutrient concentration at all four larval densities. At lower nutrient concentration, higher larval density resulted in higher individual larval weight and total larval yield, revealing an interaction between larval density and dietary quality. Larval crude protein content was higher at lower densities and lower nutrient concentration. Larval crude fat was higher at higher larval densities and nutrient concentrations. This study indicates that larval protein content is regulated within narrow limits, whereas larval crude fat content is strongly affected by nutrient concentration and by larval density.