Counting sheep: Who came up with this old sleep tip, and does it work?

Sign up for CNN’s Sleep, But Better newsletter series. Our seven-part guide has helpful hints to achieve better sleep.

Trying to imagine fat, fuzzy white lambs, jumping one by one over a fence, is a well-known remedy for sleeplessness. When I used to try this, I would insert a dapper black sheep with a red bow tie now and again — a nod to my inner rebel.

I don’t have insomnia often (thank heavens), but I’ve often wondered just who came up with such a silly suggestion. If the idea is to bore yourself to sleep, why not count backward as you do when undergoing anesthesia? And who decided on sheep? Why not jackrabbits, horses, giant toads or kangaroos?

History supposedly provides the answer: It was said to be a way for medieval shepherds, devoid of human company for weeks at a time, to fall asleep each night — they counted their sheep until drowsy. Whether that’s true or not, I don’t know.

What is clear is that the concept of counting sheep to sleep is so old it was mentioned in a 13th century compilation of short stories titled “Cento Novelle Antiche.” In one of the novellas, a storyteller in the service of Messer Azzolino was so sleepy that he told his master a tale of a farmer trying to get a flock of sheep across a swollen river in a small boat.

“So he jumped in with a single fleece, and began to row with all his might,” the storyteller said. “The river was broad, but he rowed and he rowed away. …”

The storyteller stopped talking as he fell asleep, prompting his master to prod him awake to finish the tale.

“Let him get over the remainder of the sheep, and then I will proceed; for it will take him a year at least, and in the meantime your excellency may enjoy a very comfortable slumber,” the fabulist replied before nodding off again.

In Miguel de Cervantes' "Don Quixote," Don Quixote and Sancho Panza discussed counting goats — not sheep — to help Quixote sleep. - Hulton Archive/Hulton Archive/Getty Images
In Miguel de Cervantes' "Don Quixote," Don Quixote and Sancho Panza discussed counting goats — not sheep — to help Quixote sleep. - Hulton Archive/Hulton Archive/Getty Images

The same tale was told in the earlier 12th century work “Disciplina Clericalis,” and even became part of the 17th century book “Don Quixoteonly in this version Quixote’s squire, Sancho Panza, tells him to count goats, not sheep.

You’d better keep track of how many goats the shepherd carries across, your grace, because if we forget a single one that will be the end of the story, and it won’t be possible to tell another word,” Panza tells him.

Does counting sheep work?

So does counting sheep really help you fall asleep? Search online, and you’ll soon find stories about a 2002 study on combating insomnia that put the concept to the test.

In reality, that wasn’t the point of the research, said senior author Allison Harvey, a professor of psychology and director of the Golden Bear Sleep and Mood Research Clinic at the University of California, Berkeley.

“Our study more than 20 years ago wasn’t about counting sheep; it was just about using imagery to fight insomnia,” said Harvey, who conducted the research while a professor of psychology at Oxford University.

Her research split 50 people into three groups, Harvey said. The first had no instructions on how to fall asleep, while members of the second were told to distract from thoughts, worries and concerns in any way they wanted. The third group was instructed to perform an interesting and engaging imagery task, such as creating or remembering a meadow, a waterfall, a holiday or a summer afternoon in the sun.

Those who used imagery reported falling asleep much faster than either of the two other groups, and they rated their thoughts, worries and concerns to be less uncomfortable and distressing than people in the distraction or no instruction group.

As it happened, two of the study participants in the distraction group did count sheep as a way to fall asleep “and somehow people latched onto that, I guess because they thought it was fun,” Harvey said.

While she didn’t actually study counting sheep as a way of overcoming insomnia (and isn’t aware of any other studies to do so), Harvey does have an opinion based on her years as a sleep specialist.

“Something as mundane as counting sheep usually does not do the trick,” she said. “Instead, we work out a menu of options with people, because everyone is different and not one option is going to help every single time.”

What does work?

There are science-backed ways to help yourself empty your mind and fall asleep, however. More than 20 years later, using your imagination still remains a top tip, Harvey said. Here are her other recommendations.

Visualize relaxation: Envisioning a pleasant and engaging environment does work for many people and is most successful when all five senses are involved.

“Try to make your image as vivid as possible by asking yourself what you see, what you hear, what you smell, and if it applies, what you taste,” she said.

Gratitude: Known for boosting happiness, counting your blessings is also a good way to relax and sleep, according to research.

Harvey suggests coming up with three things in your life that you are grateful for and then saying those to yourself before sleep.

Savoring: A cousin of gratitude, savoring is about reliving a wonderful moment from your day. Remember what happened, how you felt and let yourself bask in those good feelings to encourage sleep, Harvey said.

The next three suggestions are best done before your head hits the pillow, and all focus on controlling worry and rumination (which is chewing on repetitive thoughts much like a cow chews cud).

Problem-solving: Find a time before you hit the sack to pick up a pen or pencil and make two columns on a sheet of paper. Label the top of one column “Concerns” and the other “Solutions.”

List your problems or worrisome tasks in the concerns side and then brainstorm some potential fixes. Getting it down on paper frees your mind from chewing on it (so to speak).

Journaling: Keeping a diary or journal doesn’t have to focus on problem-solving, although it could, Harvey said. It can be a place to capture blessings and daily memories that you want to retrieve later — or just a way of expressing yourself.

Worry time: Not a writer by nature? Well, you can set aside a few hours before bed to just worry away and (hopefully) come up with solutions. Doing so can get it out of your head before your head hits the pillow, allowing sleep to come without counting sheep.

For more CNN news and newsletters create an account at