a b s t r a c tThe surface effect in the bending of nanowires (nanobeams), including cantilever nanowires and fixedfixed ones, is investigated in this paper with a recently developed elastic theory for nanomaterials, in which only the bulk surface-energy density and the surface-relaxation parameter are involved as two independent parameters to characterize the surface effect. Closed-form solutions of the maximum deflection and the effective elastic modulus in both kinds of nanowires are achieved. It is found that, comparing to the prediction of the classically elastic beam theory, the cantilever nanowire is softened, while the fixed-fixed one is stiffened by the surface effect in nanoscales, consistent well with the existing experimental measurements. Furthermore, an increasing aspect ratio of nanowires can further enhance the stiffening behavior of fixed-fixed nanowires and the softening behavior of cantilever ones, respectively. The present result should be helpful not only for explaining different surface effects in nanowires with different boundary conditions, but also for the design of nano-structures and nano-devices related to nanowires.