ABSTRACT: Across taxa, egg survival is a critical component of reproductive success. Eggs in aquatic environments can be strongly influenced by both extrinsic and intrinsic factors, of which egg density in particular has been subjected to a limited body of research. In this study, we experimentally manipulated both egg density and water salinity—a key environmental condition—and assessed egg infection rate and survival in a small marine fish with paternal egg care, the sand goby Pomatoschistus minutus. We controlled for the potential confounding effect of parental care by rearing the eggs artificially. We found that both high salinity and reduced egg density treatments were associated with a higher proportion of eggs surviving to the eye-spot stage. Furthermore, the positive survival effect of reduced density was more pronounced (in relative terms) in low salinity. In contrast, a reduced egg density was actually negatively associated with the proportion of healthy-looking, uninfected eggs in high (but not low) salinity. The first signs of infection, in turn, appeared quicker under low salinity, independent of density. Together, these results demonstrate context-dependent effects of density on egg performance, and identify a potentially significant role for parental care (especially filial cannibalism) in suppressing the spread of egg infections. Furthermore, the benefits of a low egg density are not only related to infections, but they can also vary depending on the physical environment. Overall, the results highlight the role of egg performance in the face of changing environmental conditions.