A method is provided for purifying nucleic acid from a sample in a microfluidic device. The method can be used to purify nucleic acids from any source known in the art that comprises nucleic acids, such as prokaryotic or eukaryotic organisms, viruses, cell, tissues, organs, etc. In a specific example, the tissue is whole blood. The method for purifying nucleic acid may run fully automated in the microfluidic device.