This paper proposes a smart window for radiative cooling with adjustable transparency by leveraging the phase transition property of VO2. The proposed smart window exhibits daytime visible light transmission and near-infrared light reflection, all-day radiative cooling, and a nighttime privacy protection feature. It comprises a bottom layer of VO2/Ag/VO2 and top cubic two-dimensional SiO2 gratings, with structural parameters optimized by the genetic algorithm to ensure excellent optical performance. In the daytime, 75.4% visible light transmittance and 87.8% near-infrared reflectance can be achieved by utilizing the dielectric state of VO2. It also achieves low light transmission of 9.8% by using the metallic state of VO2, which is suitable for nighttime privacy protection. Furthermore, it has an all-day outside emissivity of 98.2% for radiative cooling, together with a low inside emissivity of 1.9% for effectively inhibiting the radiation heat transfer. In addition, the proposed structure is insensitive to the angles of incidence and the polarization of light, making it advantageous for radiative cooling. During the daytime, it reduces the temperature by 17.7 K compared to a glass of equal thickness when the non-radiative heat coefficient is 12 W/m2/K. At night, it achieves a cooling power of 124.7 W/m2, achieving a cooling effect of 8.9 K below ambient temperature. The proposed smart window is promising for various application scenarios for radiative cooling and privacy protection and could be used as windows for buildings and vehicles.