Large-scale artificial reef constructions have been carried out in the coast of northern Yellow Sea, which has effectively enhanced populations of rocky reef fish species. However, there is a lack of evidence regarding the differences in community composition among different types of artificial reef habitats. This study scrutinizes the foraging dynamics and ecological niche partitioning of Hexagrammos otakii and Sebastes schlegelii, which are two representative rocky reef fish species in the northern Yellow Sea. Stomach content analysis indicates that H. otakii exhibits a more diverse diet compared to S. schlegelii, with both species achieving the highest dietary diversity within concrete reef habitats. When factoring in body size, the dietary diversity for fish in the 0–15 cm size class was found to be the greatest within rock reef habitat, while larger individuals exhibited higher diversity within ship artificial reef habitats. The prey composition results demonstrate spatial differentiation patterns consistent across all size classes, with these discrepancies predominantly situated between ship and concrete or rock artificial reef habitats. The taxa driving these differences varied with fish species and body size, encompassing various prey categories such as Decapoda, Teleost, Polychaeta and Amphipod. Findings from the Stable Isotope Mixing Model (SIMMR) revealed significant dietary variations linked to species, habitat type and size class, which were fundamentally in agreement with the stomach content analysis. Niche analysis disclosed that overall niche breadth for both fish populations was largest in concrete artificial reef habitat. This suggests that each reef type caters to specific fish size classes, showcasing distinct spatial and interspecific variations in foraging tactics.