Gelelectrophoresis is used to separate DNA fragments according to their size. The DNA fragments are placed onto an agargel and a voltage is applied across it.
The resistance of the agargel used in electrophoresis means that the larger the fragments, the more slowly they move. Therefore, over a period of time, smaller fragments will move further than large ones.
If the DNA fragments in gelelectrophoresis are labelled (e.g. with radioactive DNA probes) then their final positions in the gel can be identified by placing a sheet of X-Ray film over the agar gel for several hours. The radioactivity from each DNA fragment exposes the film and shows where the fragment is situated on the gel.
Only DNA fragments up to 500 bases long can be sequenced using gel electrophoresis, therefore larger genes and whole genomes must be cut into smaller fragments by restriction endonucleases.