Lead halide perovskites have attracted considerable attention as one of the most promising materials for optoelectronic applications. The structural, electronic, and optical properties of the cubic perovskite CsPbF3 were studied using density functional theory in conjunction with plane waves, norm-conserving pseudopotentials, and Perdew-Berg-Erzenhof flavor of generalized gradient approximation. The obtained structural parameters are a good agreement with the experimentally measured and other’s theoretically predicted values. The obtained electronic band structure revealed that cubic CsPbF3 has a direct fundamental band gap of 2.99 eV at point R. The calculated energy band gaps at the high symmetry points agree with the other available theoretical results. The GW method is adapted to correct the underestimated fundamental energy gap value to 4.05 eV. The contribution of the different bands was analyzed from the total and partial density of states. The electron densities show that Cs and F have strong ionic bonds, whereas Pb and F have strong covalent bonds. The optical properties of CsPbF3 were calculated using the density functional perturbation theory and Kramers-Kronig relations. The wide and direct bandgap nature and the calculated optical properties imply that cubic CsPbF3 can be used in optical and optoelectronic devices for high frequencies visible and low frequencies ultraviolet electromagnetic radiation.