An Electroencephalogram (EEG) is a painless medical test that records the brain's electrical activity, or brain waves, using electrodes attached to the scalp. It helps diagnose neurological conditions like epilepsy and seizure disorders, as well as other brain problems like sleep disorders and changes in consciousness, by identifying abnormal patterns in brain activity.