An electrochemical sensor was fabricated utilizing ionic liquids possessing cations with long alkyl chains such as trimethyl octadecylammonium and behenyl trimethylammonium and ascorbate anion. The ionic liquids were drop-coated onto the electrode. Thin modifying layers were prepared. Cyclic voltammetric investigations revealed electrostatic interactions between the electrochemical probes and the modified surface, proving that a positive charge was established at the film surface. Hence, negatively charged species such as nitrite can be pre-concentrated on the surface of presented modified electrodes. The fabricated electrodes have been used as a voltammetric sensor for nitrite. Due to the electrostatic accumulation properties of long alkyl cation, the assay exhibits a remarkable improvement in the voltammetric response toward nitrite oxidation. The influence of pH on the electrode response was thoroughly investigated, and the mechanism of the electrode was established. The developed sensor showed a linear electrochemical response in the range 1.0–50 μM with a detection limit of 0.1 μM. The electrode revealed good storage stability, reproducibility, and anti-interference ability. The determination of nitrite performed in curing salts brought satisfactory results.Graphical abstract