The objective of this paper is to study the postbuckling behaviors of an unknown-length nanobeam combined with small-scale effects. The concept of variable-arc-length elastica is firstly applied on the problem of nanobeams. The span length is not changed while the arc length is varied increasingly. The nanobeam is on a clamped support at one end, while the other end is an overhanging part through a frictionless slot subjected to axial compression. At this end, the nanobeam is movable only in a horizontal direction. The governing equation is developed by the moment–curvature relationship based on the classical Euler–Bernoulli beam theory, including the effects of nonlocal elasticity, residual surface stress, and both combined effects. The shooting–optimization technique with two-point boundary condition is employed to solve the differential equations in this problem. The results, including nonlocal elasticity, reveal that nanobeams have decreased structural stiffness; meanwhile, the residual surface tension and both combined effects have increased strength. The postbuckling loads decrease as the arc length of nanobeams is increased. The equilibrium configurations are close to an anti-loop for very large deflections. The friction force at the nanoslot is also considered.