In this study, we examine the effect of surface density of disks on chemical evolution of galaxies. We find that, higher surface brightness galaxies on average possess higher gas-phase metallicity compared to lower surface brightness galaxies with the same stellar and gas mass. The surface brightness effect is more significant for low-mass galaxies. Using an analytical model of chemical evolution involving gas outflow and accretion, we find that the surface brightness dependence can be attributed to the strength of inflowing pristine gas. Galaxies with lower surface brightness experience stronger inflow than galaxies with a higher surface brightness of a similar mass.