Dilution is one of the common chemical procedures which are carried out in all chemistry laboratories-to prepare standard solutions with different concentrations for assay calibration, and to reduce matrix effects while handling complex samples. Yet dilution is mostly performed manually using large-volume manual liquid-handling tools (volumetric flasks, graduated cylinders, and pipettes). Here we describe a simple continuous and automated method of diluting complex samples and stock solutions using an Arduino-based control unit. The proposed plug-volume-modulation approach relies on continuous introduction of short plugs of samples separated with short plugs of solvent. The train of sample pulses is generated by opening and closing two pinch valves interchangeably, so that either sample or solvent can enter the mixing zone (T-junction). The plugs of sample and solvent are pulled along a transfer flow line by a peristaltic pump. They mix due to advection, turbulence, and diffusion. The effluent of the flow line supplies diluted samples with well-defined dilution factors. The desired dilution factor is programmed by setting the duration of sample and solvent pulses injected in every cycle. The sample duty cycle effectively determines the dilution factor. Initially, we verified the quality of the generated diluted samples by off-line and online optical detection. We further demonstrated the usefulness of this dilution generator when selecting the optimum dilution factors for complex samples analyzed by direct infusion electrospray ionization mass spectrometry. The proposed method eliminates conventional glassware from dilution steps. Hence, it can readily be incorporated into automated analytical systems.