The mechanisms of nanoindentation on single-walled carbon nanotubes (SWCNTs) have been studied by using molecular dynamics simulation and continuum analysis during which a flat layer of diamond atoms is pressed down incrementally on a vertically aligned SWCNT. SWCNTs are divided into three distinct categories based on their aspect ratios, such that the nanotube behavior transits from a shell (short tube) to a beam (long tube). Molecular dynamics simulations are used to explore the diverse indentation characteristics in each domain, where the relationships between the strain energy and indentation depth during loading, unloading, and reloading are continuously recorded. The nanoindentation mechanisms are characterized by the critical indentation depth, maximum strain energy and force associated with buckling, as well as with the evolution of carbon bond length and morphology of the SWCNTs. Bifurcation behaviors are explored by investigating the loading-unloading-reloading behaviors of the nanotubes. Parallel finite element simulations are also used to study the pre- and post-buckling behaviors of SWCNT by incorporating the van der Waals interaction into the continuum code. It is found that, for the most part, continuum analysis can effectively capture the overall indentation characteristics, yet some details related to the atomic characteristics of nanoindentation may only be revealed by molecular dynamics simulation. Finally, an indentation mechanism map is derived by comparing behaviors of SWCNTs with different aspect and section ratios. Focusing on the effects of nanotube length, this paper is the first of a series of numerical studies on the indentation mechanisms of carbon nanotubes, which may be used to determine the intrinsic mechanical properties of SWCNTs by means of nanoindentation.