Amphiphilic sodium polysulfonates containing 0.5 mol % of the azobenzene (Abz) moiety and 49.5 mol % of lauryl (La), cyclododecyl (Cd), or adamantyl (Ad) groups in the side chains were prepared. As a reference polymer, a sodium polysulfonate with 0.5 mol % of the Abz moiety without the hydrophobic group was also prepared. In the former, the Abz residues are 'compartmentalized" in hydrophobic domains of the La, Cd, or Ad groups, while in the latter, the Abz residues are exposed to water in aqueous solution. Photoisomerization (trans to cis) of the Abz residues was significantly impeded as a result of the compartmentalization owing to motional restrictions imposed on the trans Abz isomers in the hydrophobic domains. The initial rates of the thermal cis-to-trans back-isomerization, on the contrary, were accelerated in the compartmentalized systems, presumably owing to conformational strains in photogenerated cis isomers in the hydrophobic domains. Such steric effects of the compartmentalization on both the photochemical and thermal isomerizations were dependent on the hydrophobic groups surrounding the Abz residues, the steric constraint decreasing in the order Cd > Ad > La.