Why Does My Body Hurt When I Sleep?

Sleep-related body pain usually stems from a combination of prolonged pressure on soft tissues, reduced movement that stiffens joints, and hormonal shifts that dial up inflammation during the night. For many people, the fix is as straightforward as swapping a mattress or adjusting a pillow. But persistent or worsening pain that routinely wakes you, especially in the second half of the night, can point to conditions that deserve a closer look.

Staying Still Is Harder on Your Body Than It Sounds

When you are awake, you shift your weight constantly without thinking about it. During sleep, you spend long stretches in one position, and gravity does not take a break. Lying on your side, the full weight of your torso presses down through a relatively small contact area at your shoulder and hip. One hypothesis on why so many people develop shoulder pain links it directly to this sustained compression: hours of pressure from the weight of the chest on the downside shoulder can damage soft tissue enough to produce pain the next day, and over weeks or months, real injury.

1PubMed. Sleep position and shoulder pain

Your spine is affected too. In side-lying, the degree to which your spine stays straight depends almost entirely on how well the surface beneath you supports the curve at your waist while letting your shoulder and hip sink in. When researchers measured spinal angles in men sleeping on their sides across different mattress types, they found significant differences in alignment between soft, firm, and custom-fitted surfaces.

2PubMed Central. Spine alignment in men during lateral sleep position: experimental study and modeling

A mattress that is too firm holds the shoulder and hip up, bending the spine into a lateral curve. One that is too soft lets the heaviest parts sink too far, creating the opposite problem. Either way, muscles along the spine work all night to compensate, and you wake up stiff and sore.

A scoping review looking at how sleep posture relates to spinal symptoms in adults found that waking pain and stiffness were the complaints most commonly tied to sleeping position, and that side-lying was generally protective against spinal symptoms compared with other postures.

3BMJ Open. Identifying relationships between sleep posture and non-specific spinal symptoms in adults: A scoping review

That is good news for the majority of people who sleep on their sides, but it comes with a caveat: “protective” does not mean “painless.” Even in a generally favorable position, a bad mattress or pillow can undo the benefit.

How Your Mattress and Pillow Factor In

The old advice that a firm mattress is best for your back turns out to be wrong. A large randomized trial assigned people with chronic low-back pain to either medium-firm or firm mattresses and tracked them for 90 days. Patients on medium-firm mattresses reported less pain in bed, less pain on rising, and less disability than those on firm ones.

4The Lancet. Effect of firmness of mattresses on chronic non-specific low-back pain: randomised, double-blind, controlled, multicentre trial

A systematic review of controlled trials reinforced the point, finding that medium-firm mattresses improved sleep quality by roughly 55% and reduced back pain by about 48% in people with chronic low-back pain.

5Sleep Health. Effect of different mattress designs on promoting sleep quality, pain reduction, and spinal alignment in adults with or without back pain; systematic review of controlled trials

If your mattress is more than seven or eight years old, its support characteristics have likely changed, even if it looks fine on the surface. And if you have gained or lost a significant amount of weight since buying it, the effective firmness you experience will be different from what it was.

Pillows matter just as much for the upper body. The height of your pillow directly affects how your cervical spine is angled while you sleep, which in turn determines how much stress your neck muscles absorb overnight.

6PubMed Central. Ergonomic Consideration in Pillow Height Determinants and Evaluation

Researchers measuring head-neck biomechanics across different pillow heights found that raising pillow height from flat to the tallest option increased the cervical angle by over 66%.

7PubMed Central. Effect of pillow height on the biomechanics of the head-neck complex: investigation of the cranio-cervical pressure and cervical spine alignment

A pillow that is too tall pushes the head up and to one side when you are on your side, straining the muscles and joints on one side of the neck. A pillow that is too flat lets the head drop, producing the same kind of asymmetric strain in the opposite direction. The ideal height fills the gap between the mattress and the side of your head so the neck stays roughly level with the rest of the spine. That gap differs depending on your shoulder width, which is why one person’s perfect pillow is another person’s source of neck pain.

Why Inflammatory Pain Gets Worse at Night

Not all nighttime pain is about posture. Inflammatory conditions such as rheumatoid arthritis follow a circadian rhythm in which pain and stiffness surge in the early morning hours. The mechanism involves a tug-of-war between cortisol, which has anti-inflammatory effects and drops to its lowest levels in the middle of the night, and melatonin, which rises as part of the sleep cycle. Melatonin plays a role in promoting certain inflammatory processes, including inhibiting an enzyme involved in joint damage and inflammatory pain.

8PubMed Central. Circadian pain patterns in human pain conditions – A systematic review

The result is that inflammation creeps up precisely when your body’s natural brake on it is at its weakest. If you wake up with hands that feel swollen and locked, or joints that take more than half an hour of morning movement to loosen, this circadian inflammatory cycle is a likely contributor.

Inflammatory Back Pain and What Sets It Apart

Most back pain is mechanical: it flares with activity and eases with rest. Inflammatory back pain does the opposite. It tends to improve with movement and worsen with prolonged rest, which means sleeping is exactly the wrong activity for it. The hallmark features include morning stiffness lasting more than 30 minutes, pain that wakes you specifically during the second half of the night, pain that gets better with exercise, and alternating buttock pain. When at least two of those four features are present, the combination has reasonably good accuracy for identifying inflammatory back pain as distinct from ordinary mechanical back pain.

9PubMed. Inflammatory back pain in ankylosing spondylitis: a reassessment of the clinical history for application as classification and diagnostic criteria

Conditions like ankylosing spondylitis, a form of arthritis that primarily affects the spine, are the classic cause. The disease often starts in people under 40, and because early symptoms look like generic back pain, it is frequently missed for years. One key distinction clinicians rely on: mechanical low-back pain tends to hurt with lifting, bending, or standing for long periods, while inflammatory low-back pain tends to produce morning stiffness on waking and pain that increases with rest.

10PubMed. Mechanical or inflammatory low back pain. What are the potential signs and symptoms?

If you notice that your back pain actually feels better after 20 minutes of moving around in the morning but always seems worst right when you get out of bed, that pattern is worth mentioning to a doctor.

Nerve Compression and Nighttime Tingling

Waking up with numb, tingling fingers is so common that many people assume it is just “sleeping on your arm wrong.” Sometimes it is. But recurring nighttime tingling in the thumb, index, and middle fingers often points to carpal tunnel syndrome, a condition where the median nerve gets squeezed in a narrow channel at the wrist. Nighttime paresthesia is actually one of the defining symptoms of carpal tunnel syndrome, and sleep position plays a direct role: wrist flexion during sleep increases pressure inside the carpal tunnel, compressing the nerve. A systematic review found that lateral side sleeping was the most common position among carpal tunnel patients and was associated with increased nighttime symptoms.

11International Journal of Allied Health Sciences. THE RELATIONSHIP BETWEEN MEDIAN NERVE COMPRESSION IN THE CARPAL TUNNEL AND SLEEPING POSITION: A SYSTEMATIC REVIEW

Interestingly, the picture is not the same for people without an existing nerve problem. A study of healthy adults without carpal tunnel syndrome found that higher body mass index and sleeping with the wrist flexed predicted more frequent nighttime tingling, but side sleeping on its own was actually linked to fewer symptoms in that group.

12PubMed Central. Preferences in Sleep Position Correlate With Nighttime Paresthesias in Healthy People Without Carpal Tunnel Syndrome

The practical takeaway: if your hands routinely wake you up tingling, a wrist brace worn at night that keeps the wrist in a neutral position can help. If the tingling persists, a nerve conduction study can clarify whether the problem is positional or structural.

Restless Legs and Nocturnal Cramps

Some nighttime discomfort is not about lying still but about your body refusing to stay still. Restless legs syndrome produces an uncomfortable urge to move the legs that appears or worsens during rest, peaks in the evening and nighttime hours, and improves with movement. The chronic sleep disruption that comes with it is tied in part to this circadian pattern, with symptoms clustering right when you are trying to fall asleep.

13PubMed Central. Effects of restless legs syndrome (RLS) on sleep

People with restless legs syndrome often describe the sensation as crawling, aching, or pulsing deep inside the legs, and they frequently display involuntary periodic leg movements during sleep that can wake them or their partner.

14Nature Reviews Disease Primers. Restless legs syndrome

Nocturnal leg cramps are a separate phenomenon. These are sudden, involuntary contractions of the calf or foot muscles, often painful enough to jolt you awake. A case-control study identified three factors independently associated with nighttime calf cramps: muscle twitching, tingling in the lower limbs, and weakness in the muscles that pull the foot upward.

15PubMed. Factors associated with night-time calf muscle cramps: a case-control study

Dehydration and electrolyte imbalances are often blamed, but the evidence for those as primary causes is thinner than people assume. In many cases, nocturnal cramps are linked to underlying neuromuscular issues. If cramps happen more than a few times a month and disrupt your sleep, it is worth having the nerve and muscle function in your legs evaluated rather than just drinking more water.

Jaw Clenching and the Pain That Travels Downward

Many people do not connect their morning headaches or neck stiffness with what their jaw is doing overnight. Sleep bruxism, which involves clenching or grinding the teeth during sleep, does not just stress the jaw. Researchers measuring muscle activity during bruxism episodes found that the jaw muscles and neck muscles fired together in the vast majority of episodes. Specifically, coordinated activity between the jaw-closing muscles and both the sternocleidomastoid and trapezius muscles of the neck was present in about 85% of bruxism events studied.

16PubMed Central. Coherence of jaw and neck muscle activity during sleep bruxism

That means every time you clench, your neck is clenching too. Over a full night, hundreds of these episodes can produce significant fatigue and soreness in the neck and upper shoulders by morning. Psychological stress appears to play a larger role in driving the associated muscle pain than the mechanical grinding itself.

17PubMed Central. Myofascial temporomandibular disorder pain, parafunctions and psychological stress

A night guard can protect the teeth, but managing stress and addressing sleep quality tend to be more effective for reducing the associated body pain.

Fibromyalgia, Sleep Apnea, and Widespread Pain

When pain is not localized to one joint or one body region but seems to be everywhere, sleep itself may be part of the problem rather than just the backdrop. Fibromyalgia is characterized by widespread musculoskeletal pain that is closely linked to poor sleep, fatigue, and mood disturbances. In a study of 165 fibromyalgia patients, the degree to which pain was centralized (processed and amplified by the central nervous system rather than arising from local tissue damage) correlated with worse sleep quality, greater fatigue, and lower quality of life.

18Oxford Academic. The relationship of centralized pain in fibromyalgia syndrome with sleep, fatigue and quality of life

In fibromyalgia, the pain-sleep relationship runs in both directions: pain disrupts sleep, and poor sleep amplifies pain sensitivity the next day, creating a cycle that is hard to break without addressing both sides.

Obstructive sleep apnea can produce a similar pattern of widespread body pain. In a study of sleep apnea patients, more than half reported chronic widespread musculoskeletal pain, with women affected more often and more severely.

19PubMed Central. Chronic widespread musculoskeletal pain in patients with obstructive sleep apnea syndrome and the relationship between sleep disorder and pain level, quality of life, and disability

The connection may involve fragmented sleep reducing the body’s ability to repair tissues overnight, as well as the low oxygen levels during apnea episodes potentially driving inflammation. If you wake up aching all over, snore heavily, and feel exhausted despite what you thought was a full night’s rest, a sleep study can rule sleep apnea in or out.

Medications That Can Cause Nighttime Muscle Pain

Sometimes the source of the pain is not in the bed or in your body’s mechanics but in the medicine cabinet. Statins, the widely prescribed cholesterol-lowering drugs, are well known for muscle-related side effects. These range from mild soreness and cramps to more significant weakness, and the effects are dose-dependent, meaning higher doses carry higher risk.

20PubMed. Statins and skeletal muscles toxicity: from clinical trials to everyday practice

The muscle adverse events associated with statins include cramps, myalgia, weakness, and in rare cases more severe damage.

21PubMed Central. Statins Neuromuscular Adverse Effects

Statin-related muscle pain tends to be diffuse rather than localized to one spot, and people often notice it most at rest or overnight when the muscles are not being used. If you started a statin and your nighttime body pain appeared or worsened within weeks to months afterward, that timing is worth flagging with your prescribing doctor. Switching to a different statin, lowering the dose, or adjusting when you take it can sometimes resolve the problem without giving up the cardiovascular benefit.

Temperature and Its Underrated Role

Cold environments can quietly contribute to overnight stiffness and discomfort. When your skin temperature drops, muscles tense to generate heat, and that sustained low-grade contraction throughout the night can leave you feeling sore by morning. A study testing partial-body heating on young women sleeping in cold indoor conditions found that warming the lower body significantly raised skin temperatures at the toes and calves, improved thermal comfort ratings, and produced better sleep quality compared with sleeping without supplemental heat.

22Elsevier / Building and Environment. Effect of partial-body heating on thermal comfort and sleep quality of young female adults in a cold indoor environment

You do not need a fancy device to apply this finding. Keeping your bedroom at a moderate temperature, wearing socks to bed in cooler months, or using a heated mattress pad can reduce the muscle tension that comes from spending eight hours trying to stay warm. Conversely, sleeping in a room that is too hot disrupts sleep architecture in its own way, so the sweet spot is a mildly cool room with enough bedding to keep skin temperature comfortable, not tropical.

When Night Pain Deserves Medical Attention

Most nighttime body pain is benign: a bad pillow, a worn-out mattress, stress-related clenching, or a mild condition that improves with simple changes. But clinicians use the concept of “red flags” to identify back and body pain that may signal something more serious. A review of low-back pain guidelines found that pain at night or at rest was consistently listed as a red flag across guidelines for multiple serious underlying conditions, including spinal infection, fracture, and malignancy.

23PubMed. Red flags presented in current low back pain guidelines: a review

No single red flag on its own is highly accurate at detecting serious disease, and most people with nighttime pain do not have a dangerous underlying cause. But the combination of multiple warning signs increases the probability considerably.

24PubMed. The diagnostic value of Red Flags in thoracolumbar pain: a systematic review

Signs that warrant a prompt visit include pain that wakes you consistently and cannot be relieved by any change of position, unintentional weight loss alongside the pain, a history of cancer, fever or night sweats, and progressive neurological symptoms such as numbness spreading to the groin or loss of bowel or bladder control. Any one of these combined with persistent night pain should be taken seriously rather than attributed to a bad mattress.