Metal nitride, carbonitride, and oxycarbonitride powder with high surface area (up to 150 m.sup.2 /g) is prepared by using sol-gel process. The metal organic precursor, alkoxides or amides, is synthesized firstly. The metal organic precursor is modified by using unhydrolyzable organic ligands or templates. A wet gel is formed then by hydrolysis and condensation process. The solvent in the wet gel is then be removed supercritically to form porous amorphous hydroxide. This porous hydroxide materials is sintered to 725.degree. C. under the ammonia flow and porous nitride powder is formed. The other way to obtain high surface area nitride, carbonitride, and oxycarbonitride powder is to pyrolyze polymerized templated metal amides aerogel in an inert atmosphere. The electrochemical capacitors are prepared by using sol-gel prepared nitride, carbonitride, and oxycarbonitride powder. Two methods are used to assemble the capacitors. Electrode is formed either by pressing the mixture of nitride powder and binder to a foil, or by depositing electrode coating onto metal current collector. The binder or coating is converted into a continuous network of electrode material after thermal treatment to provide enhanced energy and power density. Liquid electrolyte is soaked into porous electrode. The electrochemical capacitor assembly further has a porous separator layer between two electrodes/electrolyte and forming a unit cell.