This research paper presents a novel methodology that integrates electrochemical techniques, specifically electromembrane extraction (EME) and vortex-assisted switchable hydrophilicity solvent-based liquid-phase microextraction (VASHS-LPME). Electrochemical analysis allows for the sensitive detection of Hg(II). The study investigated the impact of vortexing during the switch of the extraction solvent for the first time. Additionally, it explored the potential of vortexing as an alternative to time-consuming temperature control processes, the use of hazardous acids like HCl, and dry ice. The study examined the utilization of potato dextrose agar (PDA) gel as a membrane in EME, eliminating the need for an organic solvent in Hg(II) extraction. We optimized the experimental conditions and found that by meeting specific parameters, we could efficiently extract Hg(II) from a 20 mL solution sample using a PDA gel-based membrane in an aqueous acceptor phase. Subsequently, the VASHS-LPME method was applied under optimal conditions for the extraction of Hg(II) ions. The study demonstrated a linear range of 0.0075–100 μmol L−1, with a limit of quantification (LOQ) and limit of detection (LOD) ranging from 0.0075 to 0.0022 μmol L−1. The precision values obtained for intra- and inter-day relative standard deviations (RSDs) were 3.8 % and 4.3 %, respectively. The technique proposed in the research was effectively employed to determine the quantity of Hg(II) in food and water samples.