The work function of carbon nanotubes might depend on their diameters and the number of walls, and be different for their tips and sidewalls. Here we report the work function measurement of single-walled, double-walled, and multiwalled carbon nanotubes by investigating the thermionic emission from the middle of their bundles. It is found that the sidewall work functions of the three kinds of carbon nanotubes are all around 4.7-4.9 eV; the diameter and the numbers of walls have no obvious influence on their work functions. For the carbon nanotube bundle with some tips appearing in the middle, the measured work function is smaller than without tips, indicating that the work function of tips is smaller than that of the sidewalls. This tip effect also results in a difference in the thermionic emission characteristic, implying non-uniform work function distribution along the bundle.