Overfishing and eutrophication affects coastal communities worldwide, leading to dwindling fish stocks and deteriorated habitats. Hence, attempts to rebuild overfished stocks to past fish productivities need to account for functional relations between habitat types and fish performance. Here we quantify resource availability, foraging performance and anti-predator behaviour of juvenile Atlantic cod (Gadus morhua) to assess the costs and benefits associated with different coastal habitats. In the laboratory, Atlantic cod foraged more efficiently in sand habitats compared to the structurally more complex habitats of eelgrass (Zostera marina) and the canopy forming bladderwrack (Fucus vesicolosus). Presence of chemical cues from a cannibal reduced Atlantic cod consumption rates in all habitats, but most pronounced in the sand habitat. Field observations in the three habitats showed highest resource density in the bladderwrack habitat and lowest in the sand habitat, irrespective of season. Habitat profitability, calculated by combining data from field estimates of prey density and experimental quantifications of foraging performance, revealed the bladderwrack habitat most profitable independent of season. The difference in profitability between the complex habitats was relatively small, suggesting that Atlantic cod in the field contributed to drive habitat profitability towards equalization. The results strengthen the view that the ongoing loss of seagrass and macroalgae habitats may have significant ramifications for juvenile Atlantic cod performance, which ultimately may lower the productivity of entire stocks. Consequently, future and ongoing rebuilding of commercial fish stocks should revise the expectations of stock productivity (and hence harvesting intensity) accordingly.