Photoresponsive change in the basal spacing of cationic azo dye-layered silicate intercalation compoundswas investigated using X-ray diffraction under controlled humidity conditions to investigate the mechanism of the photoresponse triggered by trans-cis photoisomerization. The molecular design of azo dyes was conducted and two cationic azo dyes (phenylazobenzene and phenylazonaphthalene) were used to obtain intercalation compounds with different packing and hydration. Whereas the trans-phenylazobenzene-layered silicate hardly adsorbed water vapor, the trans-phenylazonaphthalene intercalation compound strongly interacted with water. Both azo dyes photoisomerized in the interlayer space reversibly. Under the relative humidity of 95%, the basal spacing of the phenylazobenzene-silicate increased upon UV irradiation, confirming that the change in the basal spacing was caused by the photoinduced hydration. Under the relative humidity of 6.8%, the basal spacing of the phenylazonaphthalene-silicate decreased upon UV irradiation, suggesting that the packing of the phenylazonaphthalene in the interlayer space was changed to be compacted by the photochemical conversion to the cis-form.