Chemical bonding as well as structural, electronic and optical properties of CsPbF3 are calculated using the highly accurate full potential linearized augmented plane-wave method within the framework of density functional theory (DFT). The calculated lattice constant is found to be in good agreement with the experimental results. The electron density plots reveal strong ionic bonding in Cs-F and strong covalent bonding in Pb-F. The calculations show that the material is a direct and wide bandgap semiconductor with a fundamental gap at the R-symmetry point. Optical properties such as the real and imaginary parts of the dielectric function, refractive index, extinction coefficient, reflectivity, optical conductivity and absorption coefficient are also calculated. Based on the calculated wide and direct bandgap, as well as other optical properties of the compound, it is predicted that CsPbF3 is suitable for optoelectronic devices and anti-reflecting coatings. © 2011 Chinese Physical Society and IOP Publishing Ltd.