We use very deep spectra obtained with the Ultraviolet-Visual Echelle Spectrograph in the Very Large Telescope in order to determine the physical conditions, the chemical abundances and the iron depletion factors of four H II regions of the Large Magellanic Cloud and four H II regions of the Small Magellanic Cloud. The spectral range covered is 3100-10400 $mathring{A}$ with a resolution of $Deltalambda sim lambda / 8800$. We measure the intensity of up to 200 emission lines in each object. Electron temperature and electron density are determined using different line intensity ratios. The ionic and total abundances are derived using collisionally excited lines for O, N, S, Cl, Ne, Ar, and Fe. The uncertainties are calculated using Monte Carlo simulations. This is the largest available set of high quality spectra for H II regions in the Magellanic Clouds. Thus, we can derive chemical abundances and depletion factors and constrain their variations across each galaxy with better accuracy than previous studies. In particular, we find that the amount of Fe depleted on to dust grains in the H II regions of the Magellanic Clouds is similar to that found in Galactic H II regions.