Some ways that stiff neck can develop while sleeping include:
- Awkward angle. The head or neck might settle at an awkward angle for an extended period of time while sleeping, which can stretch and stress muscles, ligaments, and joints beyond their normal limits.
- Sudden movement. Perhaps from rolling over or reacting to a dream, sudden neck movements might occur while sleeping that can strain or sprain the neck.
- Pre-existing injury. Some injuries that happen while awake, such as whiplash, may take many hours before pain and stiffness develop later while sleeping.
Most commonly, the root cause of a stiff neck is a neck strain, which could be due to a muscle strain or ligament sprain. Several other causes could exist, such as facet joint osteoarthritis or cervical degenerative disc disease. https://www.nhslanarkshire.scot.nhs.uk/services/physiotherapy-msk/neckpain/