The size dependent free transverse vibration of the micro- and nanocantilever mass sensors is studied. The general case of a sensor with an arbitrary number of attached particles is considered. The domain is divided into different segments at the cross-sections where the particles are located, and the displacement fields are described based on the Bernoulli-Euler beam theory. The size effect is introduced into the formulation by assuming the constitutive equation of the stress-driven nonlocal theory of elasticity. The eigenvalue problem is generated by solving the equation of motion in each segment of the sensor and imposing the variationally consistent and higher-order constitutive boundary and continuity conditions. The natural frequencies and their sensitivity to the attachment of a small mass are analyzed analytically. It is shown that the frequency shifts resulting from attachment of a small mass can be explicitly defined as a function of the frequency and mode shape of the unloaded sensor. The model is used to numerically study the natural frequencies of sensors loaded by one to three particles. Comprehensive results are presented on the effect of the size dependency on the frequency shifts of the first four modes of vibration. It is revealed that neglecting the size effect may result in wrong detections of the masses of the attached particles.