The present study was concerned with the synthesis of thin films and nano samples from heavy oil fly ash (HOFA) doped-calcium carbonate (CaCO3) with different contents (x = 0, 1, 2, 3, 4, and 5 wt%.). The motivation of this study was to benefit from fly ash resulting from heavy oil combustion in power plants in optoelectronic applications rather than as an environmental problem with repercussions including global warming, etc. The nano- and thin-film samples with a thickness of 200 nm were controlled and tuned by the monitor device and were prepared by the spin coating method on pre-clean glass substrates. The structural analysis was carried out using XRD and SEM techniques. Both techniques were proven on the crystallinity of the studied samples, and the structural parameters were calculated, such as grain size, which was affected by the increase in calcium carbonate. Furthermore, SEM images of thin-film surfaces revealed a more packed structure with a lower number of pores in the thin film containing nano-CaCO3. According to the optical spectra (transmittance T, reflectance, R), the optical absorption coefficient was calculated. Then, the related optical parameters (Tauc energy Eg, Urbach energy Eu), optical constants (an extinction coefficient kex., a reflective index n), and dispersion parameters (a single oscillator energy Eo, a dispersion energy Ed) were determined. It was clear that these layers have the great potential to be used as a window layer in solar cells and other optoelectronic applications due to the high energy range of the optical bandgap. In addition, all-optical properties were affected and improved by increasing the calcium carbonate content. This improvement in the optical properties along with the improvement of the structural properties makes the thin films and the nanoscaled samples very suitable for various applications.