We compared the concentrations of 17 heavy metals and essential elements in post-hatching eggshells of two waterbirds, the obligate piscivorous great cormorant Phalacrocorax carbo (GCM) and the more omnivorous grey heron Ardea cinerea (GHR), breeding sympatrically in eight mixed colonies in Poland. We found significant inter-species and inter-colony differences in the levels of most of the elements. GHR had significantly higher concentrations of Al, which can be explained by its very low stomach pH: an acidic environment favours the release of Al compounds. Differences in Mn, Ni, Cu, Se and Hg concentrations can be attributed to the various contributions of fish and other aquatic organisms to the diet, and to the exploration of different habitats (GCM exclusively aquatic, GHR a wider range) and microhabitats (GCM, in contrast to wading GHR, dive for food, exploring the whole depth range of water bodies), differently exposed to contamination by those elements from sediments. Inter-colony differences were related to the level of industrialisation. We recorded higher levels of some elements in the eggshells (Fe, Mn in both species and Cr, Ni and Zn in GCM) collected in industrialised areas, which may be associated with the negative environmental impact of industrial areas.Electronic supplementary materialThe online version of this article (10.1007/s11356-018-3765-5) contains supplementary material, which is available to authorized users.