An EEG (electroencephalogram) test is done to record the electrical activity of the brain. This test is often used to help diagnose and monitor conditions such as epilepsy, brain tumors, head injuries, sleep disorders, and certain neurological and psychiatric conditions.