Based on a comparative study between the piezoelectric outputs of n-type nanowires (NWs) and n-core/p-shell NWs along with the previous study (Lu et al 2009 Nano. Lett. 9 1223), we demonstrate a one-step technique for identifying the conductivity type of individual ZnO nanowires (NWs) based on the output of a piezoelectric nanogenerator without destroying the sample. A negative piezoelectric output voltage indicates an NW is n-type and it appears after the tip scans across the center of the NW, while a positive output voltage reveals p-type conductivity and it appears before the tip scans across the central line of the NW. This atomic force microscopy based technique is reliable for statistically mapping the majority carrier type in ZnO NWs arrays. The technique may also be applied to other wurtzite semiconductors, such as GaN, CdS and ZnS. © 2009 IOP Publishing Ltd.