Are you constantly tossing and turning at night and looking for ways to get better sleep? Enter: cognitive shuffling, a method that's going viral as a "hack" for dozing off quicker. It's perfect for when you have a million racing thoughts—like how you're going to get the kids to school tomorrow to the major project looming at work.

Cognitive shuffling is essentially distracting yourself from the chatter by "switching from deep thinking to random thinking," Sara Benjamin, MD, medical director of the Johns Hopkins Sleep Disorders Center, tells Women's Health. It involves visualizing random images to help you drift off.

The sleep hack has become popular on social media, with some users claiming that it helps distract them from stressful thoughts that are keeping them awake. And while some TikTok trends aren't legit, experts say there could be something to this hack.

So, how does the "cognitive shuffle" work, and should you give it a try the next time you're lying awake? Here's what sleep health experts say.

Meet the experts: Sara Benjamin, MD, is a physician and medical director of the Johns Hopkins Sleep Disorders Center. Luc P. Beaudoin, PhD, is a cognitive scientist and professor at Simon Fraser University. Fariha Abbasi-Feinberg, MD, is a sleep specialist and spokesperson for the American Academy of Sleep Medicine.

What is cognitive shuffling?

Although the hack has gained attention online, cognitive shuffling isn't exactly a widely-known term in the sleep field. Luc P. Beaudoin, PhD, a cognitive scientist and professor at Simon Fraser University, tells WH that he first came up with the concept as an undergraduate student studying cognitive psychology in 1989. He was struggling with insomnia and claimed the method helped him. But it wasn't until around 2009 as a researcher that he began to formally study the cognitive shuffling technique.

Here’s how it works: When you’re lying in bed, visualize random scenarios, without trying to string them together. For example, maybe you’re holding cotton candy at an amusement park, getting cozy in a sleeping bag while camping or throwing a frisbee in a park.

The original idea was to mimic the fleeting images you have before falling asleep. One of Beaudoin peer-reviewed studies about cognitive shuffling, presented in 2016 at a joint meeting of the American Academy of Sleep Medicine and the Sleep Research Society, was small but showed some promising improvements to sleep quality among 154 college student participants (137 female).

The study investigated the use of a cognitive shuffling exercise—called a Serial Diverse Imagining Task (SDIT)—as a way of helping participants deal with their racing mind before bed. An app presented recordings of random words one at a time with an eight-second interval between each to help participants create a mental image of each word (similar to how cognitive shuffling would work in real life). Sleep quality improved significantly for participants who completed this task at bedtime, the study found—and pre-sleep arousal (think: being mentally alert, worrying, having the jitters) was reduced.

At a glance, the cognitive shuffle technique may sound similar to the concept of “counting sheep,” but focusing on the same object over and over might be too repetitive and precise, preventing your mind from truly resting, Beaudoin says.

Does cognitive shuffling work for sleep?

Experts stress that cognitive shuffling remains a theory, not a proven practice. While Beaudoin's studies were encouraging, more research needs to be done.

Research has shown similar practices to be helpful, though. Some experts say cognitive shuffling is similar to the concept of cognitive behavioral therapy (CBT), a type of psychotherapy that helps you work through everyday life challenges by identifying, managing, and reshaping your thoughts. CBT is also considered an effective treatment for insomnia, per research in the American journal of lifestyle medicine.

The random things you come up with during cognitive shuffling may seem silly, arbitrary or even counterproductive—if your thoughts are racing, do you really want to add more thoughts to the mix? However, experts say focusing your attention on random things signals to your brain and body that you're safe.

Cognitive shuffling is also similar to yoga nidra, which is the practice of mentally scanning the body by slowly bringing awareness to each part. Yoga nidra may improve sleep because it calms the sympathetic nervous system and boosts the parasympathetic nervous system, which tells the body it doesn't need to be in fight-or-flight mode, per a study published in PLOS One.

Though there isn't enough research to be conclusive when it comes to cognitive shuffling for sleep, experts say there's no downside to trying it for yourself.

"It's a method to try to get them to focus on something a little bit different that perhaps breaks their thought patterns," says Fariha Abbasi-Feinberg, MD, a sleep specialist and spokesperson for the American Academy of Sleep Medicine.

How To Try The Cognitive Shuffle For Sleep

Ready to try cognitive shuffling yourself? Get in your jammies, turn the lights off and follow these expert-recommended pointers:

  • Stick to some guidelines. Experts say you should stick to a specific area of words to ensure that you don't go off daydreaming up a whole narrative story. "The brain is naturally inclined to 'make sense,' and I'm suggesting that it's breaking up the sense that's important," Beaudoin says. First, try thinking of all the words you can that start with the same letter—"P," for instance—before switching to another, Beaudoin says. (If you need some guidance, Dr. Beaudoin also created an app called mySleepButton, which can play random words or scenes aloud for you if you're not fully feeling up to the creative task.)
  • Instead of just thinking of a word, actually visualize it. Picturing your actual dog—playing fetch, chomping on a chew toy or curled up in bed—seems to be more helpful than just seeing the word "dog" in your mind. "If you add the visualization, it slows your mind a bit because you have the word and then the visual picture with it," Dr. Benjamin says.
  • Make yourself the star of the show. To really reap the benefits, visualize yourself in a specific scenario, Beaudoin says. For example, don't just picture a tub of popcorn—picture yourself working behind the movie theater concessions stand scooping popcorn.
  • Know when to ask for help. While cognitive shuffling could be beneficial for some, if you regularly have trouble sleeping, experts say it may be time to put the technique to bed and call in a doctor. "If [sleep issues are] affecting your life to the point that you have trouble focusing or functioning during the day, if it's affecting your relationships, if you're having trouble driving… you absolutely have a sleep disorder that needs to be evaluated," Dr. Abbasi-Feinberg says. Talking with a primary care provider who can refer you to a board-certified sleep specialist may help, she says.