Using simple sensors for the fast determination of heavy metal ions in different samples, such as food or environmental, is necessary to identify, monitor, and manage the effects of toxic metal pollution. In this regard for the first time, a glassy carbon electrode modified based on the electropolymerization of L-tyrosinamide (L-TyrNH2) as (PL-TyrNH2/GCE) was reported to mercury ions (Hg2+) detect via the differential pulse anodic stripping voltammetry (DPASV). The L-TyrNH2 electropolymerization synthesized a conductive polymer directly on the working electrode surface. The PL-TyrNH2/GCE determined Hg2+ concentration with a good linear range from 0.5 to 1800 pM, and limit of detection (LOD) was 0.16 pM using a DPASV technique. The PL-TyrNH2/GCE was elective toward mercury ions in the presence of other ions and acted selectively. Applicability of the sensor for measurement of Hg2+ in soil and river water samples was displayed with a satisfactory recovery range between 99.2 and 105.2%. Moreover, the proposed sensor performs well in terms of reproducibility, repeatability, and stability. The proposed sensor is widely applicable to increase the ability of electrochemical sensors to monitor toxic metal pollution. To validate the results, the inductively coupled plasma-optical emission spectroscopy (ICP-OES) technique was used as a standard method to detect mercury ion concentration in real samples. This is a preview of sub