The corrosion resistance of martensitic stainless steels (MSS) depends strongly on the chemical composition and the applied heat treatment. Both determine the distri-bution of the alloying elements in the microstructure and the resulting material prop-erties. The addition of nitrogen is known to be beneficial for the pitting corrosion re-sistance of stainless steels. In case of MSS this effect is not only connected to nitro-gen itself because nitrogen can be used to substitute carbon which also influences the result of the heat treatment process. This paper shows the effect of nitrogen on the corrosion resistance in relation to the hardening process of MSS. Therefore the effects of austenitization duration, austenitization temperature and cooling rate on microstructure, hardness and corrosion resistance were studied on the MSS X30CrMoN15 1 and X50CrMoV15. The effect of different cooling rates was studied using the jominy end quench test. The changes in corrosion resistance were detect-ed with electrochemical potentiodynamic reactivation (EPR) and by the determination of critical pitting potentials. Besides this experimental approach thermodynamic calculations with the software thermocalc will be presented and used for the interpretation of the effect of nitrogen on the corrosion resistance of MSS.