Hydrophilic copolymers containing N-isopropylacrylamide and acrylate with coumarin or 4-methylcoumarin moieties have been synthesized. We reveal that the copolymers with a very small content of coumarin and 4-methylcoumarin units exhibit macroscopic photoinduced and reversible sol-gel conversions. UV light (λ>310 nm) irradiation of aqueous solutions for the copolymers causes the increase in viscosity and the formation of hydrogels, based on photodimerization of coumarin moieties. Subsequent irradiation with UV light (λ=254 nm) of the hydrogels induces the return of fluidity and the change to sol state, due to the decomposition of coumarin dimers. The amount of crosslink structures in the copolymers can be regulated by the reversible photoreaction of coumarin moieties.