Completely renewable energy can be produced by using water solutions of different salinity, like river water and sea water. Many different methods are already known, but development is still at prototype stage. Here I report a novel method, based on electric double-layer capacitor technology. Two porous electrodes, immersed in the salt solution, constitute a capacitor. It is first charged, then the salt solution is brought into contact with fresh water. The electrostatic energy increases as the salt concentration of the solution is reduced due to diffusion. This device can be used to turn sources of salinity difference into completely renewable sources of energy. An experimental demonstration is given, and performances and possible improvements are discussed.