Objective
To separate the DNA fragments based on their Molecular weight.
Theory

Agarose gel electrophoresis is the easiest and most popular way of separating and analyzing DNA. Here DNA molecules are separated on the basis of charge by applying an electric field to the electrophoretic apparatus. Shorter molecules migrate more easily and move faster than longer molecules through the pores of the gel and this process is called sieving. The gel might be used to look at the DNA in order to quantify it or to isolate a particular band. The DNA can be visualized in the gel by the addition of ethidium bromide.
Agarose is a polysaccharide obtained from the red algae Porphyra umbilicalis. Its systematic name is (1 4)-3, 6-anhydro-a-L-galactopyranosyl-(1 3)-β-D-galactopyranan. Agarose makes an inert matrix. Most agarose gels are made between 0.7% and 2% of agarose. A 0.7% gel will show good separation for large DNA fragments (5-10kb) and a 2% gel will show good resolution for small fragments with size range of 0.2-1kb. Low percentage gels are very weak (Note:- it may break when you lift them) but high percentage gels are usually brittle and do not set evenly. The volume of agarose required for a minigel preparation is around 30-50ml and for a larger gel, it is around 250ml.

Structure of agarose
Factors Affecting the Movement of DNA:
Voltage Applied
The migration rate of the linear DNA fragments through agarose gel is proportional to the voltage applied to the system. As voltage increases, the speed of DNA also increases. But voltage should be limited because it heats and finally causes the gel to melt.
Ethidium Bromide(EtBr)
It is an intercalating agent which intercalates between nucleic acid bases and allows the convenient detection of DNA fragments in gel. When exposed to UV light, it will fluoresce with an orange colour. After the running of DNA through an EtBr-treated gel, any band containing more than ~20 ng DNA becomes distinctly visible under UV light. EtBr is a known "mutagen", however, safer alternatives are available. It can be incorporated with agarose gels or DNA samples before loading, for visualization of the fragments. Binding of Ethidium bromide to DNA alters its mass and rigidity, and thereby its mobility.
Buffers
Several different buffers have been recommended for electrophoresis of DNA. The most commonly used buffers are Tris-acetate-EDTA (TAE) and Tris-borate-EDTA( TBE). The migration rate of DNA fragments in both of these buffers is somewhat different due to the differences in ionic strength. These buffers provide the ions for supporting conductivity.
Conformation of DNA
DNA with different conformations that has not been cut with a restriction enzyme will migrate with different speeds. Nicked or open circular DNA will move slowly than linear and super coiled DNA (slowest to fastest: nicked or open circular, linear, or super coiled plasmid). Super helical circular, nicked circular and linear DNAs migrate gels at different rates through agarose gel. The relative nobilities of these three forms depend on the concentration, type of agarose used to make the gel, applied voltage, buffer, and the density of super helical twists.