The pinacol coupling is a significant method for carbon–carbon bond formation. Here, we present an efficient electrochemical approach for pinacol coupling of aldehydes and ketones using TMSN3 as a sacrificial reagent. This method exhibits broad applicability to aryl, heteroaryl, and alkyl aldehydes/ketones with excellent chemo-selectivity and high yields (40 examples, up to 99% yield) under mild conditions. This method can also be applied in the selective reduction of phthalimides to hydroxyl lactams in good yields. The proposed mechanism was elucidated by control experiments and cyclic voltammetry.