The theoretical investigation of the size dependent behavior of a Bernoulli–Euler dielectric nanobeam based on the strain gradient elasticity theory is presented in this paper. The variational principle is utilized to derive the governing equations and boundary conditions, in which the coupling between strain and electric field, strain gradient and electric field, and strain gradient and strain gradient are taken into account. Different from the classical beam theory, the size dependent behaviors of dielectric nanobeams can be described. The static bending problems of elastic, pure dielectric (nonpiezoelectric), and piezoelectric cantilever beams are solved to show the effects of the electric field-strain gradient coupling and the strain gradient elasticity. Comparisons between the classical beam theory and the strain gradient beam theory are given in this study. It is found that the beam deflection predicted by the strain gradient beam theory is smaller than that by the classical beam theory when the beam thickness is comparable to the internal length scale parameters and the external applied voltage obviously affects the deflection of the dielectric and piezoelectric nanobeam. The presented model is very useful for understanding the electromechanical coupling in nanoscale dielectric structures and is very helpful for designing devices based on cantilever beams.