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 forested pathway. 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 boiler man, Kamajii 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, the elderly Witch and owner of the bath house, 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 a magic medicine made from special herbs.
Chihiro discovers Haku's true form, a dragon, when he takes Chihiro to see her parents. Later, he is attacked in dragon form by shikigami in the form of paper birds controlled by Zeniba, Yubaba's twin sister. Haku had stolen and swallowed Zeniba's seal under orders from Yubaba, which has a spell on it that gave Haku internal bleeding and lacerations. Chihiro tries to help Haku recover from his injuries using the medicine given to her by the river spirit, which acts as an emetic to the dragon, causing him to vomit, and 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 seal, 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, Yubaba's pet raven (who has been turned into a small, fly-like creature by Zeniba), 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. She explains that the seal spell has been broken by Chihiro's love and caring and that the black slug Chihiro has squashed was a curse placed on Haku by Yubaba to control him. Zeniba and Chihiro's friends make 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 and does not look back. He also promises to her that he'll meet her again, someday. The family returns to their car (now dusty and covered with fallen leaves and branches, looking as though a long time has passed) and continues to their new home. Zeniba's hair band is still in Chihiro's hair, proving her adventure to be true. In the English adaptation, the film ends as Chihiro's parents tell her that they understand her worry, to which she replies that she thinks she'll do fine. This is a change from the Japanese original, which leaves Chihiro in silent thought as the car drives away, reflecting on her adventure.
After a simple interview with Hayao Miyazaki, he stated that after Chihiro passed the tunnel, she forgot everything happened in the spirit world, including Haku and the other friends of her. In this case, we should remember Zeniba's quote, "You can't never really forget something, you just can't recall it"
Also what this movie's aiming for is Chihiro's attitude changes to become more mature and independent. She has learned a lot from the spirit world, and she'll learn to do that, in the real world.