Piezoelectric nanobeams with excellent mechanical, thermal and electrical properties are important components in micro-nano electromechanical systems, which are widely used as sensors, brakes and resonators. Based on the Euler-Bernoulli beam model, the influence of surface effect on the post-buckling behavior of piezoelectric nanobeams is analyzed. According to the surface elasticity theory and the ' core-shell ' model, the surface energy model is used to introduce the influence of surface effect. The governing equations and boundary conditions of the post-buckling of piezoelectric nanobeams under the influence of surface effects are derived by the principle of minimum potential energy. The analytical solution of post-buckling is obtained by the eigenvalue method. The influence of surface effect on post-buckling configuration, post-buckling path, amount of induced charge and critical load of piezoelectric nanobeams with different external constraints and cross-sectional dimensions are discussed. The results show that surface effect has a significant influence on the post-buckling of piezoelectric nanobeams. Considering surface effect, the effective elastic modulus and critical load of piezoelectric nanobeams are increased, and the post-buckling configuration, post-buckling path and amount of induced charge are reduced. These findings contribute to the study of micro-nano electromechanical systems based on nanobeam structures and provide a theoretical basis for the design and manufacture of nanodevices.