It's not always clear what causes encephalitis. When a cause is found, it's usually an infection or a problem with the immune system (the body's natural defences).
Encephalitis can happen if an infection spreads to the brain.
Many of the infections associated with the condition are quite common and are usually mild. Encephalitis only happens in rare cases.
Encephalitis is most often due to a virus, such as:
Encephalitis caused by a virus is known as "viral encephalitis". In rare cases, encephalitis is caused by bacteria, fungi or parasites.
You can catch these infections from someone else, but encephalitis itself is not spread from person to person.
The immune system protects the body from illness and infection. When germs enter the body, the immune system attacks them to stop them causing a serious infection.
But very rarely something goes wrong with the immune system and it mistakenly attacks the brain, causing encephalitis.
This can be triggered by:
Encephalitis due to a reaction to a previous infection is known as "post-infectious encephalitis". If it's caused by a tumour or the cause is unknown, it's called "autoimmune encephalitis".