Gold nanoclusters have the tunable optical absorption property, and are promising for cancer cell imaging, photothermal therapy and radiotherapy. First-principle is a very powerful tool for design of novel materials. In the present work, structural properties, band gap engineering and tunable optical properties of Ag-doped gold clusters have been calculated using density functional theory. The electronic structure of a stable Au20 cluster can be modulated by incorporating Ag, and the HOMO–LUMO gap of Au20−nAgn clusters is modulated due to the incorporation of Ag electronic states in the HOMO and LUMO. Furthermore, the results of the imaginary part of the dielectric function indicate that the optical transition of gold clusters is concentration-dependent and the optical transition between HOMO and LUMO shifts to the low energy range as the Ag atom increases. These calculated results are helpful for the design of gold cluster-based biomaterials, and will be of interest in the fields of radiation medicine, biophysics and nanoscience.