A first principles approach has been employed to study the elastic properties of ten zigzag and seven armchair types of single-walled carbon nanotubes (SWNTs) with the diameter varied from 0.551 to 1.358 nm. The linear elastic behavior of the SWNTs when subject to small deformation is studied by four virtual mechanical experiments: uniaxial strain, uniaxial stress, in-plane pure shear, and in-plane bi-axial tension tests. Assuming that a SWNT be transversely isotropic, a strain energy approach is used to calculate the Young’s moduli in axial and transverse directions, major Posson’s ratio, plain strain bulk, and in-plane shear moduli of the carbon nanotubes. It is found that the elastic constants are insensitive to the tube size, but show a slight dependence upon the helicity. However, the differences in the elastic moduli between zigzag and armchair nanotubes are within 10%.