The separation of nucleic acids or proteins, on the basis of their size and electrical charge, by measuring their rate of movement through an electrical field in a gel.