For high density magnetic recording, it is necessary to protect the magnetic layer from wear and corrosion with a thin carbon overcoat. On ultrasmooth disk substrates, magnetron sputtering is still the preferred technique because it can provide protective carbon layers as thin as 4 nm. Degradation of the magnetic layer occurs in the atmosphere and during hard disk operation; thus, the carbon-based overcoat functions as an indispensable component in protecting the essential magnetic layer. Moreover, carbon overcoat quality plays a vital role in the strong demand to reduce the flying height between a disk and read/write head, which in turn enhances the density of recording. The impact of sputtering conditions on the quality of deposited amorphous hydrogenated and nitrogenated carbon was assessed by the electrochemical measurement of the linear polarization resistance. The film's polarization resistance was correlated to its porosity, and a statistical method was developed to allow easy comparison of results in the data analysis. The results obtained suggest that the best overcoats are formed with a substrate voltage bias of Ϫ120 V, a very low deposition pressure of 0.9 mTorr, a dc magnetron sputtering power of 2.8 W/cm 2 , and with incorporation of ethylene gas in the Ar ϩ N 2 gas mixture. The filling of film voids increased with ion flux and decreased with increasing deposition rate.