Electrodeposition of several unary and layered double hydroxides has been achieved by electrogeneration of base from the cathodic reduction of metal salt solutions such as nitrate or perchlorate. This simple one-step preparation can be adapted as a soft chemical route to the preparation of thin films of hydroxides.