We present a comparative study of carrier diffusion in semiconductor heterostructures with different dimensionality [InGaAs quantum wells (QWs), InAs quantum dots (QDs), and disordered InGaNAs QWs (DQWs)]. In order to evaluate the diffusion length in the active region of device structures, we introduce a method based on the measurement of the current-voltage and light-current characteristics in light-emitting diodes where current is injected in an area <1 mum(2). By analyzing the scaling behavior of devices with different sizes, we deduce the effective active area, and thus the diffusion length. A strong reduction in the diffusion length is observed going from QWs (L(d)approximate to2.7 mum) to QDs (L-d<100 nm), DQWs being an intermediate case (L(diff)approximate to0-200 nm depending on the carrier density). These results show that lateral composition fluctuations, either intended or unintended, produce strong carrier localization and significantly affect the carrier profile in a device even at room temperature.