Cadmium iodide (CdI2) crystalline thin film was produced via chemical bath deposition on substrates (commercial glass). Transmittance, absorption, optical band gap and refractive index of the film were examined by UV/vis spectrum. The hexagonal form was observed in the structural properties. The structural and optical properties of CdI2 thin films, produced at different pH levels were analyzed by SEM; EDX analysis was performed for analyzing the surface properties and determining elemental ratio of the films. It has been found that some properties of the films have been changed with the pH and they were analyzed according to pH variations. The tested pH values were between 5.65 and 7.20. Optical band gap varied between 3.30 and 3.82 eV with the change of pH. Film thickness was also changed according to pH, varied from 450 to 1444 nm. Refractive index was not correlated with deposition pH, it has been found to be 1.93, 2.27, 2.19 and 2.10 for 5.65, 5.90, 6.75 and 7.20 pH levels. Extinction coefficient has behaved as refractive index, which was 0.011, 0.018, 0.016 and 0.015 at 5.65, 5.90, 6.75 and 7.20 pH levels, respectively (in 550 nm). Also, porosity was found to be negatively correlated with refractive index and reflectivity of the films, whereas it is positively correlated with transmittance and extinction coefficient. (C) 2015 Brazilian Metallurgical, Materials and Mining Association. Published by Elsevier Editora Ltda. All rights reserved.