Electroencephalography (EEG) is a test that measures electrical activity in the brain using small, flat metal discs (electrodes) attached to the scalp. It is commonly used to diagnose epilepsy, sleep disorders, and other neurological conditions by recording the brain's electrical patterns.