The effective workfunctions of single-walled carbon nanotubes of armchair (5,5) and zigzag (9,0) with various geometries have been calculated by first-principles calculations. The results show that the capped and H-terminated zigzag (9,0) carbon nanotubes exhibit a lower workfunction value than the armchair (5,5) nanotubes with a similar diameter. The open-ended (without H termination) (5,5) nanotube, on the other hand, shows a lower workfunction than the open-ended (9,0) structure. The former exhibits a significant formation of triple bonds at its mouth part after relaxation, which reduces the surface dipole and lowers its workfunction, the latter exhibits a higher density of unsaturated dangling bonds, raising its surface dipole and giving a higher value of workfunction.