When the lights go out, anxious thoughts may start creeping in — and the more you worry, the harder it is to fall asleep.

Some people find that anxiety can be especially bothersome when it strikes at night.

It can feel like your brain is going into overdrive with racing thoughts that you just can’t seem to switch off. It can impact the quality of your sleep, and when worries crop up while you’re in bed, they can seem even more looming than usual.

Many people with or without an anxiety disorder can experience racing, intrusive thoughts before bed.

There may be several reasons you’re experiencing anxiety at night, but whatever the reasons, it’s possible to keep those upsetting thoughts at bay.

Having anxious thoughts at night is actually fairly common, explains Tanya J. Peterson, a national certified counselor based in Oregon.

“Daily life provides distractions from anxious thoughts. We can busy ourselves with all of the various projects and interactions as a way to escape anxiety,” says Peterson.

At night, though, there’s nothing to distract from the various thoughts and worries swirling around in your head.

Another reason anxiety worsens at night is that fatigue makes it more difficult to cope and positively deal with our worries. “The brain simply doesn’t have the energy needed to put anxiety into perspective,” she adds.

This, says Peterson, creates the perfect storm for a flurry of anxious thoughts.

And because having anxious thoughts before bed can make it harder to get a quality night’s rest, it can make you more tired and less able to cope with future instances of nighttime anxiety. “It becomes a destructive, downward spiral,” she says.

Peterson says that general anxiety can sometimes be the result of an underlying condition. To ease your worries about this, she recommends talking with a doctor if you have new instances of severe nighttime (and daytime) anxiety.

Symptoms of anxiety are typically the same whether you experience them during the day or night, says Peterson. However, at night they tend to be more intense.

Anxiety can bring on both mental and physical symptoms.

Along with anxious thoughts, you might experience:

  • sweating
  • shaking
  • headaches
  • abdominal pain
  • a frequent need to urinate
  • joint and muscle pain
  • racing thoughts
  • a hyperfocus on memories
  • worries about the future
  • unsettling emotions
  • self-criticism
  • imagined worse-case scenarios

Some people may also experience nocturnal panic attacks. These panic attacks happen when you’re asleep, jolting you awake. Because they occur at night, they can give you quite a shock.

“During the day, you are fully awake and aware of what is happening, but when they strike at night, it can take longer to register what is happening,” says Peterson.

Nocturnal panic attacks also make it difficult to go back to sleep.

If your anxiety is keeping you up at night, Peterson recommends the following strategies for dealing with nighttime anxiety:

1. Start a pre-bedtime ritual

A bedtime routine that incorporates good sleep hygiene can help your mind relax and make it easier to get to sleep.

Peterson recommends avoiding screens and doing relaxation exercises like gentle yoga about 2 hours before your usual bedtime.

“This allows your nervous system to balance itself, switching off the sympathetic nervous system responsible for fight, flight, or freeze and activating the parasympathetic nervous system responsible for the rest-and-digest response,” she says.

2. Journal before bed

Writing out your thoughts before bed may help you avoid agonizing over them throughout the night, says Peterson.

To start journaling, you can try writing down what’s on your mind or making a note of what you’re grateful for.

3. Get snacky

A light snack before bed can help balance out your blood sugar, says Peterson.

She also recommends avoiding caffeine since it can heighten anxiety and make it tougher to get to sleep.

Drinking too much liquid before bed can also keep you up at night or interrupt your sleep. If you need to drink, try not to flood your system and stick to calming beverages like chamomile tea, suggests Peterson.

4. Get out of bed

Staying in bed with your mind racing won’t do you any good. If you can’t fall asleep because of your anxious nighttime thoughts, get up and try to do something relaxing that occupies your mind.

“The key is to keep the lights low and do something that doesn’t require a lot of thought and energy but is engaging enough to occupy your thoughts and help your body settle down,” says Peterson.

While coping strategies like improving sleep hygiene and creating bedtime rituals may help, you might also find it helpful to work with a therapist, says Peterson.

Some people also find relief with anxiety medication, she adds. You can talk with your doctor to determine if medication is the right option.

However, treatment for anxiety depends on the individual. What works for you may be entirely different from what works for someone else.

Over 20 million people in the United States alone say they have occasional sleep problems. Anxiety and sleep are linked — lack of sleep can cause anxiety, and anxiety can cause difficulty sleeping.

If you’re kept awake at night because of intrusive anxious thoughts, you’re not alone.

At night, our mind is a big open space. And when we’re tired and our minds are left wide open, we’re a lot more vulnerable to intrusive, anxious thoughts.

If your nighttime anxiety is impacting your ability to function every day, consider seeking the help of a mental health professional. If you think you may have a sleep or medical disorder that’s causing your anxiety, it can help to talk with a doctor. They may recommend you go in for a sleep study.