This work deals with the synthesis, characterization, and application of alginate-based poly ionic liquids for efficient demulsification of water in oil emulsions. For the formation of renewable poly ionic liquid (PIL), sodium alginate (S.ALG) was converted to alginic acid (H.ALG), followed by an esterification process to produce corresponding polyester, (N.ALG). In the later stages, the formed N.ALG was subjected to a quaternization reaction using either 1-bromohexadecane or 1-bromononane in order to produce PILs (BH-ALG) and (BN-ALG), respectively. Then, the two formed PILs (BH-ALG and BN-ALG) were evaluated in terms of the chemical structure, surface and interfacial tensions, thermal stability, relative solubility number (RSN), and micelle size. While testing the efficiency of as-synthesized two PILs towards the demulsification of water in heavy crude oil (W/O) emulsions, both PILs were found to be efficient. Furthermore, an increase in efficiency was observed with the increase of PIL concentration and ratio of water in the emulsions. Among the two PILs, the BH-ALG displayed higher demulsification efficiency as against the BN-ALG, and this can be due to its higher hydrophobicity, and hence its ability to disperse in heavy crude oil as a continuous phase.