Broadband omnidirectional antireflection (AR) coatings for solar cells optimized using simulated annealing (SA) algorithm incorporated with the solar (irradiance) spectrum at Earth’s surface (AM1.57 radiation) are described. Material dispersions and reflections from the planar backside metal are considered in the rigorous electromagnetic calculations. Optimized AR coatings for bulk crystalline Si and thin-film CuIn1-xGaxSe2 (CIGS) solar cell as two representative cases are presented and the effect of solar spectrum in the AR coating designs is investigated. In general, the angle-averaged reflectance of a solar-spectrum-incorporated AR design is shown to be smaller and more uniform in the spectral range with relatively stronger solar irradiance. By incorporating the transparent conductive and buffer layers as part of the AR coating in CIGS solar cells (2μm-thick CIGS layer), a single MgF2 layer could provide an average reflectance of 8.46% for wavelengths ranging from 350 nm to 1200 nm and incident angles from 0° to 80°.