Abstract We report on a new method for the preconcentration and microextraction of analytes from aqueous samples using a pH-sensitive hydrogel. It is referred to as semisolid–liquid dispersive microextraction (SSLDM) and has the advantages of both dispersive liquid–liquid microextraction (DLLME) and solid-phase extraction (SPE). The surface area of the droplets is large, so the equilibrium state is quickly reached. The high density of the gel facilitates phase separation, and disadvantages of existing methods are overcome in that there is no need for extraction and dispersive solvents (as in conventional DLLME) and no need for desorption (as in SPE). The SSLDM method integrates sampling, extraction and concentration into one single and solvent-free step. The method was exemplarily applied to the preconcentration of malachite green (MG) and crystal violet (CV) which then were quantified by spectrophotometry. Specifically, poly (styrene-alt-maleic acid), a pH-sensitive hydrogel, was used to extract MG and CV from water samples. The linear analytical range is from 0.01 to 1μmolL−1 for MG, and from 0.05 to 1μmolL−1 for CV. The correlation coefficient for MG and CV is 0.999 and 0.993, respectively. The limit of detection for MG and CV is 0.011 and 0.014μmolL−1, respectively.