Ten-year-old Chihiro and her parents are moving to a new town, much to Chihiro's displeasure. While driving, they get lost and her father decides to take a 'shortcut' down a mysterious pathway with tiny house-like stones that are where spirits live. After a short but bumpy drive, the family comes to a stop at what seems to be an abandoned theme park. Curious, the father leads his family through a tunnel and explores the park, finding a deserted town and a stall full of freshly-cooked food. The parents greedily help themselves while Chihiro refuses to eat. As Chihiro's parents are eating, she wanders off and meets a boy named Haku. Haku seems to be familiar with Chihiro and warns her to escape with her parents; she returns to find they have turned into pigs, and that the way back has become a deep river. Spirits appear and go about the park. Haku secretly takes Chihiro to a large bathhouse to avoid alerting the spirits to her presence. Haku then tells her that she must get a job from the witch Yubaba, the owner of the park's bathhouse, until he can help her recover her parents and escape.
With the help of the six-armed boiler room master Kamajii and a bathhouse servant girl named Lin, Chihiro is able to convince Yubaba to give her a job; in exchange, Chihiro is forced to give up her name so that Yubaba may keep her in service for eternity. Yubaba gives her new servant the name "Sen(千)," which is derived from "Chihiro(千尋)" by removing the second character and using the alternate reading of the first. Chihiro eventually learns that Haku is similarly indebted to Yubaba. Chihiro is put to work alongside Lin, helping to bathe and serve the most difficult spirits in the bathhouse. Chihiro is able to successfully bathe a "stink spirit" (later revealed to be a river spirit who had been heavily polluted), who rewards Chihiro for her service with gold and a magic medicine made from special herbs.
Chihiro discovers Haku's true form, a dragon, as he is attacked by paper birds controlled by Zeniba, Yubaba's twin sister. Haku had stolen Zeniba's sigil under orders from Yubaba. Chihiro tries to help Haku recover from his injuries using the cake given to her by the river spirit, which acts as an emetic to the dragon, thus recovering Zeniba's sigil and squashing a peculiar black slug that had been attached to it. Haku remains comatose, so Chihiro decides to travel to Zeniba's home to return the sigil, hoping to break her curse over Haku. Chihiro sets out on a train ride across the spirit world, along with a wraith-like spirit called No Face, who terrorized the bathhouse and tried to earn the affection of Chihiro, and Boh, Yubaba's gigantic infant son whom Zeniba had transformed into a mouse.
The group arrives at Zeniba's house to find that Zeniba is friendlier than expected, and that the curse on Haku was placed on him by Yubaba, but Chihiro's love and caring has broken the spell. Zeniba makes Chihiro a special hairband to show her that her friends are with her, as well as for protection, and No Face is offered to stay at Zeniba's home as her assistant. Haku, now recovered, shows up to return Chihiro to the bathhouse, explaining that Yubaba will return Chihiro's parents to normal and allow all three of them to leave in exchange for returning Boh. As they travel on Haku's dragon form, Chihiro realizes that Haku is the same river spirit that saved her as a small child when she fell into the Kohaku River, and the realization helps to break Yubaba's control on Haku completely. At the bathhouse, Yubaba reveals that Chihiro must pass one more task as part of Haku's deal: identify which pigs in the huge herd are her parents. Chihiro passes the test, as she states that none of them are her parents, and Yubaba is forced to let her and her family go. Haku escorts her to the entrance of the spirit world, telling her that her parents are waiting on the other side, but not to look back or else the deal will be broken. Chihiro rejoins her parents, not once looking back. The family returns to their car and continues to their new home. Zeniba's hair band is still in Chihiro's hair, proving her adventure to be true.