Methods, systems, and devices are disclosed for capturing, concentrating, and isolating molecules in a fluid. In one aspect, a device includes a substrate formed of a material that is electrically insulating, a microfluidic channel made of an electrically insulating material formed on the substrate to carry a biofluid containing molecules including nucleic acids, an array of electrodes formed on the surface along a parallel direction of the microfluidic channel constituting a capture region, in which the array of electrodes are operable to produce an electric field across the microfluidic channel that creates an electrostatic attractive force on the nucleic acids to immobilize them in the capture region, and a chamber formed on the substrate of the electrically insulating material and connected to the microfluidic channel, the chamber configured to have a volume less than that of the microfluidic channel, in which, when the nucleic acids are released from immobilization in the capture region, the released nuc