The electrostatic pull-in instability (EPI), within the framework of the nanoelectromechanical systems (NEMS) has been shown as a robust and versatile method for characterizing mechanical properties of nanocantilevers. This paper aims to investigate the surface effects, specifically residual surface stress and surface elasticity, on the EPI of micro and nano-scale cantilevers as well as double clamped beams. Since the cantilever has one end free, it has no residual stress, thus the strain-independent component of the surface stress or intrinsic surface stress has no influence on the EPI, as long as it has small deformation. The strain-dependent component of the surface stress or surface elasticity changes the bending stiffness of the cantilever and, consequently, induces shifts in the EPI. For double clamped beams, the effective residual surface stress comes into play and modifies the effective residual stress of the beam. The nonlinear electromechanical coupled equations, which take into account the surface effects are solved numerically. The theoretical results presented in this paper indicate that the EPI is very sensitive to the surface effects, especially when a double clamped beam is employed. The results show that the influence of surface effects on the EPI of cantilevers become more profound when the thickness is below 50 nm, while the influence on double clamped beams is significant even at sub-micron scale. The present study can provide helpful insights for the design and characterization of NEMS switches. Moreover, the results can be used to provide the proof of concepts of a new surface stress sensing method using EPI in nanomechanical sensor systems.