The present work analyses the effect of substrate deformation during the nanowire/nanotube bending test. An individual nanowire or nanotube is treated as a linear isotropic continuum. The substrate deformation is modeled by two coupled springs and the spring compliances arefunctions of the nanowire/nanotube diameter, and the Young moduli of the nanowire/nanotube and the substrates. An atomic potential is used to determine the adhesion between the nanowire/nanotube and its substrate. Consequently, a simple three dimensional Finite Element (FE) model is built to calculate the spring compliances. The load-displacement relation, which takes into account of substrate deformation, is derived in a closed form, which can be reduced to the load-displacement relations based on the simply-supported ends and the built-in ends. The numerical results indicate that the substrate deformation has a great influence on the determination of the Young modulus of a nanowire/nanotube from the bending test. The nanobridge test on carbon nanotubes is taken as an example to demonstrate the feasibility of the developed method.