Nanoindentation-induced interlayer bond switching and phase transformation in carbon nanotubes (CNTs) and graphite are simulated by molecular dynamics. Both graphite and CNTs experience a softto-hard phase transformation at room temperature at compressive stresses of 12 and 16 GPa, respectively. Further penetration leads to the formation of interlayer sp 3 bonds, which are reversible upon unloading if the compressive stress is under about 70 GPa, beyond which permanent interlayer sp 3 bonds form. During nanoindentation, the maximum nanohardness of graphite can reach 109 GPa, and CNTs 120 GPa, which is comparable to that of diamond.