An electroencephalogram (EEG) is a test that measures electrical activity in the brain using small, metal discs (electrodes) attached to the scalp. Brain cells communicate via electrical impulses and are active all the time, even during asleep. An EEG can find changes in brain activity that might be useful in diagnosing brain disorders, especially epilepsy or another seizure disorder. An EEG might also be helpful for diagnosing or treating brain tumors, brain damage from head injury, brain dysfunction that can have a variety of causes (encephalopathy), sleep disorders, inflammation of the brain (herpes encephalitis), stroke, sleep disorders, and Creutzfeldt-Jakob disease.