Insomnia can be triggered by a number of possible factors, including worry and stress, underlying health conditions, and alcohol or drug use.
Sometimes it's not possible to identify a clear cause.
Some people develop insomnia after a stressful event, such as a bereavement, problems at work, or financial difficulties.
The problem can continue long after the event has passed because they start to associate going to bed with being awake. This develops into an anxiety about sleep itself.
Having more general worriesfor example, about work, family or healthare also likely to keep you awake at night.
These can cause your mind to start racing while you lie in bed, which can be made worse by also worrying about not being able to sleep.
You may struggle to get a good night's sleep if you go to bed at inconsistent times, nap during the day, or don't "wind down" before going to bed.
A poor sleeping environment can also contribute to insomniafor instance, an uncomfortable bed or a bedroom that's too bright, noisy, hot or cold.
Drinking alcohol before going to bed and taking certain recreational drugs can affect your sleep, as can stimulants such as nicotine (found in cigarettes) and caffeine (found in tea, coffee and energy drinks). These should be avoided in the evenings.
Changes to your sleeping patterns can also contribute to insomniafor example, because of shift work or changing time zones after a long-haul flight (jet lag) .
Underlying mental health problems can often affect a person's sleeping patterns, including:
Insomnia can also be caused by underlying physical conditions, including:
In women, childbirth can sometimes lead to insomnia.
Some prescriptions or over-the-counter medications can cause insomnia as a side effect.
Check the leaflet that comes with any medication you're taking to see if insomnia or sleeping difficulties are listed as a possible side effect.
Find out about insomnia, including why it happens, what you can do about it, and what treatments your GP can offer.
Read about some of the main causes of insomnia, including stress and anxiety, lifestyle factors, other health conditions and medications.
Read about the different techniques you can try to help you get a good night's sleep if you have insomnia.