Abstract The charge collection efficiency profile along the thickness of a CdTe detector was measured for first time by using a proton microbeam and a polished cross-section of the devices. Different samples were investigated and tests were carried out along different lines from cathode to anode, with different biases and polarities, and with different shaping times. The effects of all these parameters are evident in the experimental curves. By fitting these curves, the behaviour of the drift length for electrons and holes is obtained, if a constant ratio between them is assumed. If the mobilities and trapping times are uniform, the electric field profile is obtained. The profile has a minimum at the anode and a maximum towards the cathode, at least for large bias voltage.