Typically, a doctor will ask for a blood sample and order a lumbar puncture (sometimes called a spinal tap), in which a needle is inserted into the lower back and a small amount of fluid (called CSF or cerebro-spinal fluid) is taken from the spinal canal. This may be uncomfortable but is usually not painful when a local anesthetic is used. Doctors send the fluid for tests to see if it contains viruses or substances known to be associated with certain kinds of infections, and to test its chemistry for clues.
Some hospitals are also equipped to take a biopsy , where a tiny amount of tissue is taken from the brain while the patient is under general anesthesia. It is then tested to see if it contains viruses.
Doctors also frequently order a CT Scan or Magnetic Resonance Image (MRI), in which computerized images of the brain are obtained that show the extent of the swelling and damage to the brain.
Another test sometimes used to help confirm a diagnosis is anelectroencephalogram (EEG), which records electrical events in the brain.