Today, improving the quality of the images acquired by the atomic force microscope (AFM) and obtaining the close properties of various samples are among the most important and challenging issues tackled by researchers. One of the key mechanisms of achieving these objectives is the excitation of higher modes, which raises the sensitivity of the AFM and consequently improves the resolution. To attain this goal, it is imperative to design or select a type of cantilever which is able to excite the second mode and produce maximum sensitivity in higher modes, especially the second mode. In this paper, an AFM cantilever with rectangular cross section has been investigated in air medium. The cantilever has been modeled by the Timoshenko beam model and the normal and tangential forces between cantilever tip and sample have been considered in the simulations. By changing the geometrical parameters of the AFM’s cantilever and tip including length, width, thickness of cantilever, the angle between cantilever and sample surface, mass of tip, length of tip and Radius of tip, the frequency ratio of the second mode to first mode varies. The geometrical parameters that produce the minimum frequency ratio can increase the self-excitation probability of the second mode due to the excitation of the first mode simultaneously. The optimum geometrical parameters are derived that can increase the chance of higher mode excitation. The results indicate that the sensitivity of the second mode to sample stiffness also increases optimal geometrical parameters that yield the minimum frequency ratio; and, as a result, a higher contrast is achieved and it leads users to utilize the cantilevers with optimum geometry for achieving best contrast in imaging and properties estimation of unknown samples.