The advice is so old and so universal that it feels like it has to work. Can’t sleep? Count sheep. One, two, three, picture them jumping a fence. You’re supposed to drift off somewhere around forty. The problem is that almost no one actually drifts off. They count to a hundred, lose count, start over, and lie there increasingly frustrated. By 2 AM, the sheep have become the new thing to be angry about. The technique has been retold for centuries and tested experimentally, and the experimental results are surprisingly clear: counting sheep doesn’t help and may slightly delay sleep onset compared to doing nothing.
The reason is that counting sheep is too boring. The brain processes “one sheep” or “forty-seven” in a fraction of a second and has enormous unused mental capacity left over. That spare capacity goes right back to whatever you were worrying about. You can count and catastrophize simultaneously. The counting acts as background noise rather than as a competing cognitive activity. Effective mental distractions need to be engaging enough to actually occupy the worry-generating parts of the brain, and counting fails this test.
This article covers the actual research that tested counting sheep in a sleep lab, what makes a mental distraction effective versus ineffective for sleep onset, the cognitive shuffle and imagery techniques that do work, why your brain treats worry as the default activity when nothing else is occupying it, and the broader implications for what you should actually do when you can’t sleep.
Last updated: May 31 2026
Key Takeaways
- A 2002 Oxford study by Harvey and Payne tested counting-style distraction against imagery distraction in adults with insomnia and found imagery worked while counting did not1
- The mechanism: effective sleep-onset distraction needs to be engaging enough to compete with intrusive worry thoughts; simple counting is too low-demand to do this
- Imagery techniques (visualizing a detailed peaceful scene), cognitive shuffle (jumping between unrelated mental images), and similar engaging methods perform better.
- The deeper finding is that the brain defaults to worry when given mental free space; effective sleep techniques occupy that space rather than leaving it empty.
The Experiment That Tested Counting Sheep
In 2002, Allison Harvey and Suzanna Payne at the Department of Experimental Psychology at the University of Oxford ran a controlled experiment with 41 adults experiencing insomnia1. The study’s actual focus was broader than counting sheep specifically; it was testing whether certain types of mental distraction could help with the pre-sleep racing thoughts that often delay sleep onset in insomnia.
Participants were divided into three groups:
- Imagery distraction group: instructed to mentally construct a vivid, detailed, relaxing scene (a waterfall, a vacation setting, a calm forest)
- General distraction group: instructed to use any cognitive distraction technique they preferred, including counting
- Control group: no specific instructions, told to fall asleep as they normally would
Participants tracked their sleep onset latency (how long it took to fall asleep) across multiple nights using sleep diaries1. Each participant tried multiple conditions across the study, so individual variability could be controlled for.
The results were clear. The imagery distraction group fell asleep an average of 20 minutes faster than they did on their baseline nights. The general distraction group (the one that included counting and similar simple techniques) showed no significant improvement compared to the control group; in some measures, they actually took slightly longer to fall asleep than they did without any technique at all.
The interpretation Harvey and Payne offered was that effective pre-sleep distraction needs to be cognitively engaging enough to actually occupy the worry-generating parts of the brain. Imagery requires sustained creative engagement; you have to actively construct the scene, fill in details, and sustain the image across time. This level of engagement competes with the intrusive thoughts that delay sleep. Counting is too automatic. Your brain processes “forty-seven” in milliseconds and has enormous spare capacity to keep running anxious thoughts simultaneously.
Why the Brain Defaults to Worry
The deeper finding underlying the counting sheep failure is that the brain has a strong default behavior when not actively engaged in a task. The default isn’t peaceful or empty. It’s threat assessment and problem-solving. The unoccupied brain returns to whatever incomplete problems or unresolved concerns it has been tracking, generating new variations on familiar worry themes.
This pattern is observable in brain imaging studies, where the so-called “default mode network” activates when people aren’t focused on external tasks. The default mode network is associated with self-referential thinking, autobiographical memory, future planning, and (when conditions are right for it) rumination about problems. The relevant insight for sleep is that you can’t simply “stop thinking” when you lie down. The brain doesn’t have an off switch. If you’re not occupying its attention with something specific, it will occupy itself.
For people without insomnia, the default mode activity is benign or even pleasant; minds wander pleasantly and drift toward sleep. For people with insomnia, the default mode often dwells on whatever stresses, worries, or problems are most active in life. Lying in bed becomes a time when the brain catalogs everything that needs to be solved.
The implication for the sleep technique is important. Effective interventions don’t try to empty the mind; they replace one mental activity with another. The worry can’t be silenced, but it can be displaced.
What Makes a Mental Distraction Work
Several characteristics distinguish effective sleep-onset distraction from ineffective:
Sufficient cognitive demand
The technique needs to occupy enough mental resources that worry can’t run simultaneously. Counting is too automatic; constructing a detailed scene is demanding enough. Think of it as the difference between an activity that barely uses your attention versus one that takes up most of it.
Emotional neutrality or positive valence
The mental activity should not itself be stressful, anxiety-producing, or arousing. A vivid imagined scene of a beach works; a vivid imagined scene of an upcoming work presentation does not. The distraction technique should reduce arousal rather than increase it.
No clear endpoint
The technique should be open-ended enough that you can sustain it indefinitely without reaching a natural stopping point. Counting to 100 has a clear endpoint, and reaching it (or losing count) can be frustrating. Imagining a scene can extend as long as the brain is engaged with it.
Multi-sensory engagement
Techniques that engage multiple sensory modalities (visualization plus implied sound, touch, temperature) tend to work better than single-modality ones. The richer the imagined experience, the more brain capacity it requires.
Personal relevance
People often do better with imagery that’s personally meaningful or evocative for them. The same imagined scene works differently for different people; the technique works best when adapted to individual taste.
What Tends to Actually Work
Detailed sensory imagery
The technique that won in the Harvey and Payne study. Mentally construct a specific scene in detail: a beach with specific waves, a forest with specific light through specific trees, a cabin with specific furniture, and a fireplace. Fill in details slowly: what’s the temperature, what sounds are present, what colors dominate. The active construction occupies cognitive resources.
Cognitive shuffle
A technique developed by Luc Beaudoin at Simon Fraser University. Pick a word, think of an image starting with each letter of the word, then move on without dwelling. Move between unrelated images: apple, bridge, candle, dog. The disconnected, scattered nature mimics the brain’s natural drift toward sleep, where thoughts become loose and dreamlike. Cognitive shuffle appears to reduce sleep onset latency for many practitioners.
Progressive muscle relaxation
Not a mental distraction technique exactly, but it works through a related mechanism. Systematically tense and release muscle groups from feet to head, paying attention to the sensation of release. Body awareness occupies cognitive attention while simultaneously reducing physical tension that contributes to wakefulness.
Backward listing with detail
Pick a category (movies, books, friends, vacation destinations) and list items mentally with detail. “What’s a movie I saw recently? I saw [X]. Where did I see it? With whom? What did I have to eat afterward?” The branching detail keeps the technique demanding enough to engage attention.
Breathing-focused attention
Focus on the physical sensation of breathing without trying to control it. The 4-7-8 method (inhale for 4, hold for 7, exhale for 8) adds explicit counting and breath control. The attention to physical sensation occupies cognitive resources while simultaneously activating parasympathetic (calming) responses.
Body scan meditation
Move attention systematically through the body from head to toe (or vice versa), noticing what you notice without changing anything. Similar to progressive muscle relaxation, but more focused on observation than action. Body-scan techniques pair well with bedding choices that reduce sensory friction; our roundup of the best memory foam pillows covers options that side and back sleepers tend to favor during wind-down.
What Doesn’t Work
Counting
The whole point of this article. Counting is too automatic to occupy the worrying mind. If you find yourself counting in bed, the technique is failing; choose something more cognitively demanding.
Trying to clear your mind
“Stop thinking about anything” is a famously impossible instruction. The attempt itself becomes a thinking activity, and the failure to stop thinking becomes a new worry. Don’t try to clear; try to replace.
Reviewing the day’s events
Mental replay of conversations, decisions, and events tends to activate evaluation and second-guessing. What seemed reasonable at the time looks regrettable at 2 AM. The mental replay technique that some people use to “process” the day often makes it harder to sleep.
Planning tomorrow
Pre-sleep is a terrible time for productive planning. The brain dwells on incomplete plans, generates anxiety about what needs to be done, and resists releasing the planning state. If thoughts about tomorrow arise during sleep onset, briefly write them down on a notepad and explicitly tell yourself you’ll address them in the morning.
Checking the clock
Time-checking during sleep onset is almost always counterproductive. The knowledge of how few hours of sleep remain activates anxiety. Common practice is to turn clocks away from view or cover them.
Trying harder
Sleep is one of the few human activities that gets worse when you try harder. The effort itself activates wakefulness systems. Effective techniques work by redirecting attention without forcing the underlying state change; the state change happens on its own when conditions are right.
The Cognitive Shuffle in Detail
The cognitive shuffle deserves its own section because it’s relatively new in mainstream awareness and works for many people who haven’t found other techniques effective.
The method, as developed by Luc Beaudoin, mimics the way the brain naturally transitions toward sleep. As we fall asleep, conscious thought becomes increasingly disjointed; one image leads to another that doesn’t follow logically; the rational self-narrative breaks down. Beaudoin’s idea was to deliberately produce this disjointed pattern as a way of moving the brain toward a sleep state.
The practical version: pick a word (say “table”). Spell it out: T-A-B-L-E. For each letter, think of a few items starting with that letter, holding the image briefly before moving on. T: telephone, telescope, turkey. A: alligator, anchor, attic. B: balloon, bicycle, banana. Move at a comfortable pace, not rushed. Let the images be vivid, but don’t dwell on any one.
Several characteristics make this work. The constant shifting prevents getting stuck on any single thought. The visualization is engaging enough to occupy attention. The pattern naturally produces the loose, drift-like state that precedes sleep. Many practitioners report falling asleep within minutes to a quarter hour of starting.
An app called mySleepButton implements the cognitive shuffle systematically, providing voice-guided word prompts. Some people prefer the structured version; others prefer the self-directed version.
When Mental Techniques Aren’t the Answer
Mental distraction techniques are appropriate when racing thoughts and pre-sleep worry are the primary issues. They’re not appropriate when the underlying issue is something else. Several situations call for different interventions:
Physical discomfort. If you can’t sleep because of pain, hunger, temperature, or other physical issues, address those directly. No mental technique works through significant physical discomfort.
Sleep apnea. If you’re waking repeatedly with breathing issues, mental techniques won’t help. Sleep apnea evaluation and treatment are the right path.
Restless legs. Movement sensations that prevent stillness require physical and pharmacological approaches, not mental ones.
Substance-related insomnia. Caffeine, alcohol, certain medications, and other substances can prevent sleep in ways that mental techniques can’t override. Address the substance first.
Chronic insomnia disorder. If sleep difficulty has been persistent for months and significantly affects daytime function, mental techniques are insufficient. Cognitive behavioral therapy for insomnia (CBT-I), delivered by a behavioral sleep medicine specialist or via structured online programs, is the first-line treatment with the strongest evidence base. For the specific cortisol-and-architecture issue behind early-morning waking, our why you wake up at 3 AM and what it means covers the pattern many insomniacs experience.
When to Talk to a Sleep Specialist
Several situations warrant evaluation rather than continued self-management with techniques:
- Insomnia occurring 3+ nights per week for 3+ months with daytime impairment
- Mental techniques don’t help even when applied consistently
- Sleep difficulty significantly affects work, relationships, mood, or safety
- Reliance on sleep medications more nights than not
- Suspected coexisting sleep disorder (apnea, restless legs, parasomnia)
- Significant anxiety or depression alongside sleep problems
- Sleep difficulty after a major life event without resolution
- New-onset severe insomnia in someone with no prior history
Primary care evaluation is a reasonable starting point. Behavioral sleep medicine providers, sleep specialists, and certified CBT-I therapists are appropriate for persistent issues.
Frequently Asked Questions
Are there any situations where counting helps?
For some people, counting can help if it’s elaborate enough to be cognitively demanding (counting by 7s backward from 1000, for instance, requires more mental work than simple sequential counting). The Harvey and Payne findings apply to simple counting; more demanding numerical tasks may work for some individuals as a form of cognitive distraction.
Why does counting sheep work in cultural memory if it doesn’t actually work?
The technique probably persists because it sounds intuitively reasonable, fits the general advice about thinking of something other than your problems, and occasionally seems to work (people fall asleep eventually regardless of technique, and they sometimes attribute it to whatever they were doing at the time). Cultural traditions often persist for sociological reasons rather than because they’re empirically validated.
Does meditation work as a sleep technique?
Meditation can help with sleep, though usually through general stress reduction rather than as an immediate pre-sleep technique. Brief mindfulness practice before bed may reduce overall arousal, but trying to “meditate yourself to sleep” in the moment can become another form of effort that delays sleep. Body scan meditation specifically (a form of meditation that uses body sensation as the focus) tends to work better as a sleep-onset technique than open awareness meditation.
How long should I try a technique before giving up?
If you’ve been actively engaging with a sleep technique for a while without making progress, the technique probably isn’t going to work that particular night. Get out of bed, do something quiet and low-stimulation in dim light, and return to bed when sleepy. Lying in bed, unable to sleep for hours, teaches the brain to associate the bed with wakefulness, which makes future nights harder.
Is the “military sleep technique” a real thing?
The “military sleep method” that circulates online combines progressive muscle relaxation with imagery. The source is a 1981 book about Naval Aviation pre-flight school, with claims about training pilots to sleep in 2 minutes that aren’t well-documented. The technique itself is reasonable (similar to progressive relaxation plus imagery), but the dramatic “military” claims are mostly marketing.
Sources
- Harvey AG, Payne S. The management of unwanted pre-sleep thoughts in insomnia: distraction with imagery versus general distraction. Behaviour Research and Therapy. 2002;40(3):267-277. doi:10.1016/S0005-7967(01)00012-2
