A novel formulation of the weak form quadrature element method, referred to as the locally adaptive weak quadrature element method, is proposed to develop elements for nonlinear graded strain gradient Timoshenko and EulerBernoulli nanobeams. The equations of motion are obtained based on Hamilton principle while accounting for the position of the physical neutral axis. The proposed elements use Gauss quadrature points to ensure full integration of the variational statement. The proposed formulation develops matrices based on the differential quadrature method which employs Lagrange-based polynomials. These matrices can be modified to accommodate any number of extra derivative degrees of freedom including third-order beams and higher-order strain gradient beams without requiring an entirely new formulation. The performance of the proposed method is evaluated based on the free vibration response of the linear and nonlinear strain gradient Timoshenko and EulerBernoulli nanobeams. Both linear and nonlinear frequencies are evaluated for a large number of configurations and boundary conditions. It is shown that the proposed formulation results in good accuracy and an improved convergence speed as compared to the locally adaptive quadrature element method and other weak quadrature element methods available in the literature.