Bending and buckling of piezoelectric and piezomagnetic nanobeams are investigated based upon the Euler-Bernoulli beam model and using the strain gradient theory, which is capable of accounting for higher-order magneto/electromechanical coupling as well as size effects. Governing equations and boundary conditions are extracted using the principle of minimum potential energy, and electrical and mechanical field distributions are computed using the equations obtained. The size effect is accounted for using the strain gradient theory, and nanobeam buckling is analyzed using the nonlinear von Karman strain. Nanobeam bending and buckling are examined through the Galerkin procedure. The impact of parameters such as size effects, length, thickness, material properties, external voltage, and magnetic potential is investigated, and critical load, critical voltage, and critical magnetic potential of buckling are shown to be considerably dependent upon size effects, particularly as thickness increases.