Two-dimensional (2D) Bi2O2X (X = S, Se, Te) have been reported to be promising optoelectronic materials, which have attracted immense attention from researchers. Adjustable optoelectronic materials are very impor-tant for the design and application of the device, but how to design its electronic and optical properties is rarely studied. In this research, we have systematically investigated the electronic and optical properties of 2D Bi2O2X (X = S, Se, Te), especially the response based on the number of layers and the strength of strain. We have found the lattice constants and the band gaps of the H-Bi2O2X and Z-Bi2O2X decrease as the number of layers increases, and finally approach the values of the bulk phase. Moreover, the adjustment of the number of layers can change the range of H-Bi2O2S band gap very much, and can even be adjusted from blue light energy to infrared light energy. As the layer numbers increase, the peaks of the imaginary part of the dielectric function and the ab-sorption spectrum of H-Bi2O2S shift to low-energy region (redshift). Furthermore, the band gaps of H-Bi2O2X (X = S, Se, Te), Z-Bi2O2S, and Z-Bi2O2Se increase first and decrease with the increasing compress strain, and that decrease linearly with the increasing tensile strain. Surprisingly, with the increase of tensile strain, the band gap of Z-Bi2O2Te increases first and then decreases instead of the linear decrease like other materials, which may be due to the heavier Te atoms. Our HSE06 calculation results show that the Bi2O2X is a promising tunable photodetector with a broadband photoresponse in the visible light range.