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 CuIn(1-x)Ga(x)Se(2) (CIGS) solar cells 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 mu m-thick CIGS layer), a single MgF(2) layer could provide an average reflectance of 8.46% for wavelengths ranging from 350 nm to 1200 nm and incident angles from 0 degrees to 80 degrees. (C) 2011 Optical Society of America