Rokurokubi is a Japanese Yōkai which look like humans although their neck stretches and becomes very long. The name Rokurokubi (ろくろ首, 轆轤首) may have derived from the word "rokuro" which refers to a potter's wheel, a water well's pulley or an umbrella handle which all elongates.
There is also a type of Rokurokubi which detaches their head from their body entirely called Nukekubi.
Sometimes it is said that if the body of a Nukekubi is moved while the head is detached they cannot unite again.
In Classical Literature
Rokurokubi were popular Yōkai which appeared in many different classical stories and are interpreted differently in many. In Sorori Monogatari (曾呂利物語, 1663 CE), there is a chapter called "A Woman's Wild Thoughts Wandering Around" (女の妄念迷ひ歩く事, Onna no Mōnen Mayoiaruku Koto). In this chapter the head of a woman who is sleeping separates and floats away representing her soul wandering. In the same book a man sees a floating head and chased it with a sword so the head flew home. When the woman wakes up she says "I had a scary dream. I was chased by a man with a sword".
This has later inspired similar stories such as Shokoku Kyaku Monogatari (諸国百物語, 1677 CE) and Hokusō Sadan (北窻瑣談, 1910 CE).
In the story Kokon Hyaku Monogatari Hyōban (古今百物語評判, 1686 CE) there is a chapter in which the head of an innkeeper's wife leaves her body and when it reattaches she has a ring-like bruise around her neck which is said to be a sign of the Yōkai.
In nearly all tales the Rokurokubi are female. However in Shousai Hikki (蕉斎筆記) there is a male Nukekubi.
From the Edo period onward there are tales about people's neck stretching while they are asleep. It is believed that this is derived from misinterpreted depictions of Nukekubi where it was believed that a string attached the head to the body. When this string was depicted visually people misinterpreted it as an elongated neck.
There are similar creatures in other beliefs around the world. In Chinese mythology there are the Hitōban and the Rakutō which both have heads separating from their bodies.
The Palasik, Kuyang and Leyak from Indonesia, Penanggalan from Malaysia and Krasue in Thailand have heads separating from their bodies but with their entrails still attached..
In South American folklore there is a creature called the Chonchon which takes the form of a human head and sucks the life out of people.
In Malaysian folklore there is also the Manananggal which detaches its torso from the waist up and grows bat wings.