DNA samples along with a tracking dye are first loaded into the wells of agarose gel.
Buffer solution is filled in the wells and electric current is applied.
The negatively charged phosphate groups in DNA backbones are attracted to the positive electrode, causing the DNA to migrate towards the positive electrode.
Smaller sized DNA molecules move through the gel more quickly than larger DNA molecules.
Ethidium bromide (EtBr), which is a fluorescent dye, is used to stain the DNA within the gel. On binding to DNA, EtBr emits orange light, allowing the DNA fragments to be visualized.