A nanoindenter XP with scanning capabilities was used to perform nanoindentations on GaN and ZnO nanowires with radii in the range of 20–50nm, positioned on a silicon substrate and bonded to the substrate at their ends with platinum. Since the geometry of indentation of a nanowire differs significantly from the indentation of a half-space, the standard Oliver-Pharr method [W. C. Oliver and G. M. Pharr, J. Mater. Res. 7, 1564 (1992)] of analysis may not be used. A two interface contact model has been developed for the nanoindentation of a nanowire on a flat substrate, with the two interfaces, indenter/nanowire and nanowire/substrate, being in a series. The contact at the indenter/nanowire interface is modeled as an elliptical contact at the sphere (indenter)/cylinder interface. The contact at the nanowire/substrate interface is modeled as a contact at the cylinder/half-space interface under some concentrated forces applied on top of the cylinder. Under these latter conditions the cylinder may be expected to recede from the half-space when the load is applied. In order to predict the contact stiffness for the two interfaces, the theories of Hertzian contacts and receding contacts have been reviewed, generalized, and used. Considering the possible adhesion at the nanowire/substrate interface and the fixed ends of the nanowire, we have considered two limits for the contact at the nanowire/substrate interface: one with and one without separation at the interface; thus, we obtain two bounds for the contact stiffness and hardness. The model has been used to analyze the nanoindentation data for GaN and ZnO nanowires. We found that the hardness of the GaN nanowire is 46.7±5.6GPa, which is much higher than that of the ZnO nanowire, 3.4±0.9GPa. We also found that the Oliver-Pharr hardness [W. C. Oliver and G. M. Pharr, J. Mater. Res. 7, 1564 (1992)] may be the rough lower bound of the hardness and the Joslin-Oliver hardness [D. L. Joslin and W. C. Oliver, J. Mater. Res. 5, 123 (1990)] may be the rough upper bound of the hardness.