Gel electrophoresis is used for separating nucleic acids or proteins that differ in size.

The molecules are separated on the basis of their rate of movement through a gel in an electric field.

How far a DNA molecule travels while the current is on is inversely proportional to its length.

After the current is turned off, a dye is added; this reveals the separated bands by fluorescing in ultraviolet light.