Nanoscale systems fabricated with low-dimensional nanostructures such as carbon nanotubes, nanowires, quantum dots, and more recently graphene sheets, have fascinated researchers from different fields due to their extraordinary and unique physical properties. For example, the remarkable mechanical properties of nanowires empower them to have a very high resonant frequency up to the order of giga to terahertz. In this paper, we originally propose a nonlinear model for the vibrations of piezoelectric nanowire resonators with added mass considering thermal variation, electromagnetic field, surface effects, external excitation, and nonlinear foundation. The mathematical model for such nanowires is formulated by applying the Euler–Bernoulli beam theory in conjunction with the nonlocal differential constitutive relations of Eringen type. In order to analyze the obtained nonlinear partial differential equation (PDE), we first use the Galerkin method in combination with a perturbation technique to obtain the primary and super-harmonic resonances. After finding the resonance cases, a parametric sensitivity analysis is carried out to investigate the effects of key parameters on the sensitivity of the nanowire resonators in mass sensing. Our main hypothesis is that tiny particles attached to the surface of the nanowire resonator would result in a detectable shift in the value of the jump frequency. The sensitivity analysis shows that the nanowire resonator is capable of detecting added mass in the order of zeptogram. In addition, we have developed a system identification technique based on the proposed mathematical model for the detection of tiny mass rested on the nanowire resonator that we have analyzed. Furthermore, a molecular dynamic simulation study has been presented to qualitatively verify the hypothesis of frequency shift due to the added mass. The results demonstrate a high potential of nanowire resonators in detecting tiny bio-particles such as DNA, RNA, proteins, viruses, and bacteria.