To separate DNA using agarose gel electrophoresis, the DNA is loaded into pre-cast wells in the gel and a current applied. The phosphate backbone of the DNA (and RNA) molecule is negatively charged, therefore when placed in an electric field, DNA fragments will migrate to the positively charged anode.