Thiol-modified nanoporous structured frameworks prove to be efficient trapping agents for eliminating mercury (Hg(II)) ions from water. In this work, we synthesized porous carbon nanospheres and chemically functionalized them with l-cysteine molecules following a Fischer esterification reaction and investigate them for selective Hg(II) separation. The material was characterized for functional group analysis, surface morphology and water contact angle measurement by using several spectroscopic and optical techniques likely FT-IR, XPS, SEM, TEM and goniometer analyzer. The column packed material shows selective extraction of trace Hg(II) ions at wide pH range. The selectivity of Hg(II) is primarily attributed to Lewis soft–soft acid–base chelation, wherein Hg(II) forms complexes with the thiol functionalities of the adsorbent. Density functional theory (DFT) calculations suggest that the fast energetically favorable R–SH–Hg–OR complex formed over R–S–Hg–NH–R bidentate complexes, thereby promoting selective extraction of Hg(II). The preconcentration limit for Hg(II) achieved at pH 6 was found to be 0.37 ppb. The instrumental detection limit (3 s/m) obtained after preconcentration of 11 blank runs is found to be 0.04 ppb with the relative standard deviation of 3.68 %. The accuracy of the proposed column method was validated by analyzing several real samples with enrichment factor of 100 and after spiking with varying amount of analyte. The method shows a good recovery of 97–100 % of spiked amount with RSD <5 %.