Gel electrophoresis is a technique used in the lab to separate DNA fragments according to their size. DNA samples are loaded into wells at one end of a gel, and an electric current is applied to pull them through the gel that contains small pores. DNA fragments are negatively charged, so they move towards the positive electrode.