In the present study, a nonlocal finite element method (FEM) is proposed to investigate the free vibration of functionally graded (FG) nanobeams resting on two parameters, the Winkler-Pasternak elastic foundation. Using the Eringen's nonlocal elasticity theory, the Euler-Bernoulli beam model is implemented. The equations of motion are obtained by using Hamilton's principle. Material properties of the beam vary in the thickness (height) direction based on the power law. The frequencies of functionally graded nanobeam are obtained for simply supported (S-S) boundary conditions with various values of power law exponent, small-scale (nonlocal) parameter, Winkler foundation parameter, and Pasternak foundation parameter. Vibration response of nano-scaled functionally graded beam resting on the Winkler-Pasternak elastic foundation is investigated via the nonlocal finite element method. A comparison of the numerical results of the present study with those from the open literature demonstrates a good agreement. Also, the difference between classical elasticity theory and nonlocal elasticity theory is discussed in this study.