Scanning photocurrent microscopy (SPCM) is used in semiconductor nanowire devices to establish quantitative potential profiles correlated with nonuniformities in electrical resistivity. Surface doping leads to a nonuniform axial photocurrent (a). Surface etching improves the uniformity of the local photocurrent (b) and reduces the radial and axial carrier concentration gradients (c, blue curve after etching).