Although many formaldehyde sensing materials have been developed, it is still a great challenge to get sensing materials with good selectivity. To achieve better sensing selectivity, tuning the chemical state and the amount of oxygen absorbed on the surface of semiconductor metal oxides are effective strategies. In this work, alkaline-earth elements doped In2O3 nanotubes are prepared by an electrospinning method. According to the XPS results, work function of the material and the chemical adsorption analysis, it can be concluded that the Fermi level, the basicity of the material, the activity and the amount of oxygen chemisorbed on In2O3 can be tuned by the additional alkaline-earth elements and enhance the sensing selectivity. The sensor based on 5% Ca-In2O3 shows the highest response of 116 to 100 ppm formaldehyde which is about 4.5 and 10 times higher than those of ethanol and acetone at 100 ppm and becomes the most selective among those products.