Recently it has been found that models of massive stars reach the Eddington limit in their interior, which leads to dilute extended envelopes. We perform a comparative study of the envelope properties of massive stars at different metallicities, with the aim to establish the impact of the stellar metallicity on the effect of envelope inflation. We analyse published grids of core-hydrogen burning massive star models computed with metallicities appropriate for massive stars in the Milky Way, the LMC and the SMC, the very metal poor dwarf galaxy I Zwicky 18, and for metal-free chemical composition. Stellar models of all the investigated metallicities reach and exceed the Eddington limit in their interior, aided by the opacity peaks of iron, helium and hydrogen, and consequently develop inflated envelopes. Envelope inflation leads to a redward bending of the zero-age main sequence and a broadening of the main sequence band in the upper part of the Hertzsprung-Russell diagram. We derive the limiting L/M-values as function of the stellar surface temperature above which inflation occurs, and find them to be larger for lower metallicity. While Galactic models show inflation above ~29 Msun, the corresponding mass limit for Population III stars is ~150 Msun. While the masses of the inflated envelopes are generally small, we find that they can reach 1-100 Msun in models with effective temperatures below ~8000 K, with higher masses reached by models of lower metallicity. Envelope inflation is expected to occur in sufficiently massive stars at all metallicities, and is expected to lead to rapidly growing pulsations, high macroturbulent velocities, and might well be related to the unexplained variability observed in Luminous Blue Variables like S Doradus and Eta Carina.