The work function is one of the crucial quantities in understanding their field emission properties and applying carbon nanotubes to electronic devices. We perform the systematic study of work functions of 44 kinds of isolated single-walled carbon nanotubes in the framework of the density functional theory. It has been revealed that the first-principles study plays a very important role for predicting various properties of carbon nanotubes. In general, we have to perform the structural relaxation in order to know the accurate electronic properties of carbon nanotubes. Therefore we carry out the complete geometrical relaxations for 44 kinds of carbon nanotubes and evaluate their work functions. The diameters (D) of nanotubes studied satisfy 0.3 <D< 2.0 nm. Especially, we focus on the small diameter carbon nanotubes. We determine the values of work functions from the difference between the Fermi level and the vacuum level. In the semiconducting carbon nanotubes, the Fermi level is chosen at the midgap. As a result, it is found that the carbon nanotubes should be classified into three classes according to the diameter and chiral-angle dependences of work functions.