The electronic structures for cubic WO 3 , LiWO 3 , NaWO 3 , HWO 3 , H 2 WO 3 , and hexagonal WO 3 have been calculated. The calculations rely on the local approximation to density functional theory and use a full-potential linear muffin-tin orbitals method. The incorporation of ions in tungsten oxide by chemical or electrochemical methods is the basis for several technological applications related to solid state ionics. Essentially, incorporation of alkali ions results in an s-band high above the Fermi level, and the charge-balancing electrons take part in a rigid band filling of the W d conduction band. Hydrogen forms a hydroxide unit with one oxygen atom, and we find a minimum in total energy for a bond length of 1.03 Å . The cubic phase of WO 3 can take up more than one hydrogen atom, and the formation of two hydroxide units is preferable to one water molecule. The calculated dielectric function and reflectance of Li x WO 3 and Na x WO 3 are presented, and the change in optical properties being the basis for reflective electrochromism is reproduced, although the reflectance curves show some deviations from experiments.