Herein, we report the preparation of an aerogel and a membrane from a magnetic composite material by tuning the self-assembly at the molecular level. The gel exhibits an excellent oil absorption property, and the membrane shows a remarkable autonomous self-healing property. The composite is formed from an organosilicon-modified poly(amidoamine) (PAMAM) dendrimer, which is linked with iron oxide nanoparticles and poly(vinyl alcohol). Upon the addition of a cross-linker (formaldehyde), the system undergoes a fast self-assembly and gelation process. The aerogel, obtained after drying of the hydrogel, was modified with 1- bromohexadecane at room temperature and utilized for the removal of oil from water with 22.9 g/g absorption capacity. Intriguingly, the same system forms a membrane with 97% autonomous self-healing ability, in the absence of the cross-linker. The membrane was used to remove the salt content from water with an efficiency of 85%. The control experiments suggest that the presence of the magnetic material (iron oxide) plays a key role in the formation of both the aerogel and membrane. © 2017 American Chemical Society.