In this work, an aqueous solution of sodium dodecylsulfate (SDS) surfactant is used as an additive for electropolymerization of N,N-dimethylaniline (DMA) onto carbon paste electrode (CPE), which is investigated as a novel matrix for deposition of nickel. The electrochemical oxidation of formaldehyde is studied at the surface of this modified electrode. The electrooxidation of formaldehyde was found to be more efficient on CPE modified with Ni/Poly(N,N-Dimethylaniline) (SDS), Ni/PDMA (SDS), than deposition Ni on CPE in alkaline solution. The electrochemical behavior and electrocatalytic activity of the electrode were studied using cyclic voltammetry and chronomethods studies. Also, the transfer second-order rate constant (k = 5.5 × 103 cm3 mol−1 s−1) between formaldehyde and nickel hydroxide was calculated. Moreover, in order to optimize of electrode and variables for efficient performance of Ni/PDMA (SDS)/CPE towards formaldehyde oxidations, the effect of various parameters such as number of potential cycles for preparation of polymer, nickel and formaldehyde concentration and accumulation time have been investigated.