Ion milling has been used to convert molecular beam epitaxy vacancy-doped CdxHg1-xTe from p- to n-type. Electron beam induced current and remote electron beam induced current (REBIC) measurements have been performed to study the pn junction depth and lateral extension dependence on the milling time, milling current, and vacancy concentration. The conversion depth is linear with the milling time and current and inversely proportional to the vacancy concentration in layers thinner than 10 μm. This shows that filling of Hg vacancies in this region during conversion is limited by the rate of supply of extra Hg from the milling. The lateral extension also increases linearly with the milling time, the ratio of the lateral extension to the depth being ∼0.5. One can therefore use REBIC on the top surface to determine the junction depth, which greatly simplifies the measurement and does not destroy the diodes. © 2002 American Institute of Physics.