Stretching experiments on lambda-DNA were carried out in a microfluidic channel using an inverted fluorescence microscope, micro-flow pump, and electromagnet. The micro-flow channel was fabricated by using micro electromechanical system technology, and the micro electromagnet was analyzed by computer software to simulate the magnetic field distribution. The magnetic field was 248.6 gauss at a current of 0.5 A and the system could exert 20.4 pN of force on a magnetic bead with a diameter of 2.8 µm. When the temperature of the buffer was 25 °C, the average length of lambda-DNA molecules was 1.9 µm without the magnetic field. In a magnetic field of 248.6 gauss, the extension of lambda-DNA molecules was 7.2 µm, the total length was 9.1 µm, and the coefficient of elasticity was 2.83 × 10−6 N/m. When the buffer temperature was increased to 45 °C, the average length of lambda-DNA molecules was 4.6 µm in the absence of a magnetic field. At 45 °C in a magnetic field of 248.6 gauss, the extension of lambda-DNA molecules was 11.9 µm, the total length was 16.5 µm, and the coefficient of elasticity was 1.71 × 10−6 N/m. This system can be applied to the measure the extension and coefficient of elasticity of macromolecules.