Babies squirm in their sleep because they spend roughly half their total sleep time in a light, active stage called REM sleep. During this stage, their bodies twitch, their eyes flutter, their limbs jerk, and they can look surprisingly restless, even though they’re actually asleep. Adults go through REM too, but babies spend far more time in it, which is why they seem to move constantly compared to older children or adults.
Active Sleep vs. Quiet Sleep
Newborns cycle between two broad types of sleep. REM (active sleep) is the lighter phase where movement happens. You’ll see facial grimaces, sucking motions, fluttering eyelids, and arms or legs that twitch or flail. It can look like your baby is uncomfortable or about to wake up, but this is completely normal brain activity. Babies spend about 8 of their 16 daily sleep hours in this active state.
The deeper phases of non-REM sleep look very different. In stages 3 and 4, your baby lies still, breathes evenly, and is hard to wake. The contrast between these phases is dramatic. If you watch a full sleep cycle, your baby may go from kicking and grunting to lying perfectly motionless within minutes. Because infant sleep cycles are short (around 45 to 60 minutes), they pass through the squirmy REM phase frequently throughout the night.
The Startle Reflex
One specific type of sleep squirming has a name: the Moro reflex, or startle reflex. When your baby’s brain detects a sensation of falling or a sudden noise, it triggers an involuntary response where the arms fling outward, the back arches, and the legs may kick. This reflex is present from the third trimester of pregnancy and typically disappears by around 6 months of age. It’s especially noticeable when you lay your baby down on their back, because the brief sensation of being lowered can activate it.
Swaddling helps dampen the startle reflex by keeping the arms contained. However, once your baby shows signs of trying to roll over, usually around 3 to 4 months, you need to stop swaddling. A baby who rolls onto their stomach while swaddled faces a higher suffocation risk. Transitional sleep sacks with arms free are a common next step.
Gas and Digestive Discomfort
Not all nighttime squirming is just sleep cycling. Gas is one of the most common reasons babies writhe, grunt, and pull their legs toward their belly during sleep. Bacteria in the intestines produce gas naturally, and babies also swallow air while feeding or crying. A gassy baby often has a visibly tight or distended abdomen and may pass gas frequently. The squirming you see is your baby’s body working to move that gas through an immature digestive system.
If the squirming is paired with intense crying episodes lasting three or more hours, particularly in the evening, colic may be a factor. Colicky babies often draw their legs up toward a tense abdomen, and the disrupted sleep affects the whole household. Colic typically peaks around 6 weeks and resolves by 3 to 4 months.
Room Temperature and Comfort
A baby who is too warm will squirm more. The recommended room temperature for infant sleep is 16 to 20°C (about 61 to 68°F), which feels cooler than many parents expect. To check whether your baby is overheating, feel their chest or the back of their neck rather than their hands or feet, which run cooler naturally. If the skin feels hot or sweaty, remove a layer of clothing or bedding. Skip hats indoors entirely, since babies release excess heat through their heads.
When Squirming Settles Down
As your baby’s nervous system matures, the proportion of active sleep gradually decreases. The startle reflex fades by around 6 months. Sleep cycles lengthen. By the second half of the first year, most babies spend noticeably less time twitching and writhing during sleep, though some restlessness during lighter sleep stages is normal at any age.
The shift doesn’t happen overnight. You’ll likely notice a gradual trend: fewer startles, longer stretches of still sleep, and less grunting. Some weeks may feel like a step backward, especially during growth spurts, teething, or illness, but the overall trajectory is toward calmer sleep.
Signs That Something Else Is Going On
In rare cases, persistent restless movement throughout the entire night, not just during certain sleep phases, can signal a sleep disorder. Restless sleep disorder (RSD) is a recently identified condition in children characterized by large body movements and frequent repositioning that happen all night long. It’s been found in about 8% of children referred to pediatric sleep centers, and all identified cases involved low iron stores. Children with RSD don’t necessarily have trouble falling asleep or staying asleep. Their total sleep time looks normal, but the quality is poor, leading to daytime symptoms like irritability or difficulty concentrating.
Other conditions that can drive restless sleep include eczema (itching disrupts sleep), asthma (breathing difficulty causes repositioning), and obstructive sleep apnea. If your baby’s squirming seems extreme, happens continuously rather than in phases, or is paired with labored breathing, pauses in breathing, or failure to gain weight, those patterns are worth raising with your pediatrician. For the vast majority of babies, though, the squirming you’re seeing at 2 a.m. is simply what normal infant sleep looks like from the outside.

