We achieve one-dimensional nanoscale localization of the nitrogen-vacancy (NV) defect centers in diamond by means of phasing encoding approach under gradient magnetic field. Coplanar and gradient micro-wires deposited on the diamond surface are connected in series with a power supply and voltage controlled current source. Magnetic gradient fields for NV centers phase encoding are produced by the current sent through the gradient micro-wires. We perform one dimensional localization of single NV center with nanoscale resolution of 1.5nm. The experiment results demonstrate that this technique can be extended to wide-field imaging technology, thus enabling applications in diverse areas ranging from quantum sensing to biological and life sciences.