The movie opens with the Scientist (Alan Oppenheimer
) making a sentient ragdoll on whose back he writes '9'. Outside, the world lies in ruins; the result of a catastrophic war caused by mankind's dependence on machines. Some time later, when all is silent, the ragdoll 9 comes to life. Looking around, he sees that the room he is in, 'The First Room', is a complete mess and devoid of life. He opens a window and sees the entire city before him in ruins, the sky dark and cast over. He tries to say something but nothing happens. He can't speak.
With little trepidation, he walks through the desolate and deserted city. He comes upon a car in the road and, looking inside, sees a mother and her child lying dead within. As he recoils from the sight, he hears a sound and sees a slowly approaching light. 9 hides behind some rubble, picks up a metal bar, and waits. As the light comes closer, 9 swings the bar and it connects with a creature that closely resembles him. But the other ragdoll appears older and is differently crafted, wearing a magnifying glass in front of his eyes and fitted with a lit candle on his headgear. The ragdoll, 2 (Martin Landau
), gasps at the sight of 9, who starts to run away until 2 cries out, "Wait! I'm a friend!"
9 stops and returns to help 2 from the ground, who then gives 9 an appraising look and marvels at his detail and design. When he sees that 9 can't talk, 2 instructs him to follow. They walk over to a discarded doll at the side of the road and 2 begins to fumble inside it. In the meantime, 9 picks up a bullet from the ground and begins playing with it, unaware of what it is. 2 manages to find the doll's voicebox and stops 9 before he can cause damage with the bullet, telling him that some things are better left alone. 2 then inserts the voicebox into 9's chest cavity through his zipper. After some adjustments, 9 (Elijah Wood
) finally speaks and says, "Friend".
2 then notices something inside 9 and pulls it out. The small, hemispherical device with three symbols on it is revealed to be 'The Talisman'. 2 says to himself, "He's always drawing this". A loud sound echoes nearby and 2 suddenly becomes afraid. He instructs 9 to hide inside a nearby broken can while he stands guard, armed with a spear, waiting tensely. A large 'Beast' appears and attacks 2. When it notices the Talisman, the Beast snatches it and turns its attention to 9. With its claws inches from 9's face, 2 tries to distract the Beast. The Beast turns and swallows 2, allowing 9 to find another hiding spot and evade capture. Unable to find 9, the Beast departs. Slightly damaged, his arm torn, and shaken from the attack, 9 faints. His unconscious form is soon spotted by a one-eyed ragdoll named '5' (John C. Reilly
When 9 awakens, he sees that 5 is tending to him and that his arm has been fixed. Within their hideout, 5 tells him that 2 is usually better at fixing them, unaware of 2's fate. At that moment, an elderly and domineering ragdoll called 1 (Christopher Plummer
) enters. He looks at 9 and angrily berates 5 for almost leading the Beast to them. A larger ragdoll named 8 (Fred Tatasciore
) enters and appears to be 1's bodyguard.
1 orders them to all go to the upper level of the building, which they travel to in a pulley-drawn bucket. Once there, 9 discovers that they're inside a half-destroyed church: Notre Dame. The remnants of a fighter plane lays within part of the church. 1 narrates the 'story' as he knows it. When he first awoke, he saw that there was a war between man and machine. As the ragdolls ran for their lives, 5 lost his left eye and was saved by 2. While they remained hidden, the machines proved victorious over man and deployed poisonous gas bombs that killed off all life on Earth. All that remained was the ruins, the ragdolls, and the Beasts.
1 tells 9 that all the ragdolls that were created, 3, 4, 7, and now 2, have been lost except for them. He orders 5 and 9 to go to the watchtower while, in another room, 6 (Crispin Glover
) repeatedly draws the image of the Talisman on paper with his pen-like fingers, appearing to be the one 2 was referring to. On the watchtower, 5 and 9 look through a telescope and see a large factory in the distance. 5 tells 9 that the factory is where the Beast would have taken 2, but is reluctant to rescue him despite 9's insistence. When 9 argues that 2 would have tried to save them, 5 relents and procures a map that they can use to get there.
As they walk, they discover 2's candle headpiece and 5 wonders why he was out there all alone. They search for a tunnel that will lead to their destination as a sandstorm rolls in and blows the map away. 5 and 9 continue, knowing they can't go back now. When the sandstorm dies down, they notice a large footprint on the ground that they recognize as the Beast's. Needing light, they take a small lightbulb from the headlight of a wrecked car and 9 fashions a torch-staff with it. 5 sadly notes that clever 2 was just as likely to have thought of something like that.
In the distance, the shadow of a creature with a beak finds 5's map.
5 and 9 finally arrive at the factory and find that it's a dark and imposing place. 9 turns off his light to prevent unwanted attention as they go inside. Eventually, they see a cage and discover 2 inside it. At first he is unresponsive, but slowly wakes and is happy that they've come for him. When they hear sounds nearby, 9 takes a look and sees the Beast trying to insert the Talisman into a socket of some kind. Suddenly, the Beast sees 9 and lunges to attack. At that moment, the beaked creature appears and beheads the Beast. When it removes its beaked headdress, the creature is revealed to be another ragdoll named 7 (Jennifer Connelly
). 2 and 5 are ecstatic to see her, having given her up for dead, and introduce her to 9. In the midst of their happy reunion, 9 picks up the Talisman and unwittingly inserts it into the socket. 2 notices too late and tries to stop 9, but the factory comes alive. A bright light shoots out of the central machine and strikes 2 in the eyes and mouth and drains his life force. His lifeless body falls to the ground in a heap.
With no time to mourn 2, 5, 7, and 9 run from the awakened Machine, a large spherical creature with a bright red light at its core and limb-like electrodes protruding from it. The ragdolls' escape is blocked by a chasm but 7 notices a lever overhead and uses 5's grappling gun to shoot a hook around the switch. 7 and 9 grab 5 and swing towards a conveyor belt on the other side. However, their collective weight throws the switch and the resulting jerk causes 7 to lose her grip. 5 and 9 fall onto the conveyor belt while 7 manages to grab a ledge. Activated by the switch, the conveyor belt starts to move and 5 and 9 are forced to dodge many large metallic objects. They fall to the floor below as the Machine moves menacingly towards 7, sparking its electrodes. 5 and 9 distract it with their torch-staff and the Machine gives chase. 5 and 9 are able to hide from view for a few moments and reunite with 7 in the tunnel. The Machine chases them inside but proves too large to fit in the tunnel. The ragdolls escape.
Outside the factory, 5 is devastated by 2's death, and 7 is furious at 9 for causing the chaos. However, she knows where to find answers and tells them to follow her.
Meanwhile, the Machine uses materials around it to create a new monster.
5, 7, and 9 go to a library with a large courtyard filled with statues. The ragdolls look at old paintings on the walls and see books scattered all over the place. 7 calls, and small, twin ragdolls with hoods appear: 3 and 4. Despite being mute, their eyes project video memories. As they look over 9, their eyes flash and analyze him with curiosity. 7 asks them for help, saying that they've awakened something terrible. 9 guiltily corrects her, saying that 'he' woke the creature and the twins project a video on a book describing 'The Machine'. As it turns out, the Machine was created by the very same Scientist who created them. Under orders from a dictatorial Chancellor (Tom Kane
), the Scientist commissioned the Machine and dubbed it the 'Brain'; a device that has the ability to create its own machines. The Chancellor used it to turn the tide of his war but it soon turned against mankind and destroyed the world. For some reason, it fell inactive afterwards, only to be reawakened by 9.
Eager to know more about the Talisman that woke the Brain, 9 draws the three shapes that were inscribed on it. 5 says that 6 draws those very shapes and 9 requests to see him. 7, however, refuses to return to the church, explaining that she doesn't like 1 very much before running off.
Unabashed, 5 and 9 return to the church to see 6 but are grabbed by 8. 1 enters the room, furious, and accuses them of dooming them all. 9 asks him who sent 2 out into the world alone and 1 doesn't deny it. 6 enters and sees the shapes drawn by 9. He says that the shapes are the 'Source' but, before 9 can ask more, 1 orders them all locked up. 9 calls 1 a coward but 1 angrily retorts that he'll do what it takes to keep them safe.
At that moment, the church is attacked by the Brain's newly created Beast, a creature that resembles a pterodactyl, with wings and a long beak. The ragdolls flee for their lives as the Beast's attack lights the church on fire, and they wind up on one of the wings of the crashed fighter plane. Cornered, 7 enters and tries to attack the Beast from behind but it turns and swats her away. She tries again but the Beast shoots a cabled harpoon into her leg and begins to reel her in. 9 grabs her and uses her spear to stab the Beast's wing, halting their movement. 8 arrives and cuts the taut cable which slingshots away and wraps around the fighter plane's wing propeller, causing the wing to start sliding downwards. 8 grabs a groove in the wing while 7 and 9 hold on, but 1 loses his balance and his staff. 9 grabs the staff and holds it out to 1 who grabs it. 5 and 6 land inside the propeller mechanism and turn the propeller on. The spinning propeller pulls the Beast towards it but, with a burst of strength and speed, the Beast leaps away and lands inches from 1, taking his cape in its beak. 9 yells at 1 to remove his cape. Reluctantly, 1 listens and releases it, sending the Beast snapping backwards and into the propeller where it's torn apart and destroyed.
Thanks to the fire, however, the ragdolls are now homeless and they leave the church as it burns. 1 watches sadly as their 'sanctuary' smolders. They all go to the library to live with 3 and 4.
Meanwhile, a drone takes the remnants of the Beast back to the Brain. It becomes angry until it focuses on 2's body and appears to hatch an idea.
At the library, 8 is appointed as the lookout. It's quiet outside so he takes the opportunity to use a magnet on his head to get some sort of high. While 3, 4, 6, and 9 go over the symbol drawings, 1 becomes upset about what he terms "dark science". 9 accuses him of sending 2 out to scout purposely to kill him off. Indignant, 1 says that 2 was sacrificed because he was old and weak. Furious, 7 jumps on him and puts a knife to his throat. 9 talks her down and she walks off angrily. 1 leaves as well. Short on answers, 9 decides to go to the First Room where he was created. Outside, 8 hears something and looks around. He walks tensely through the courtyard and suddenly sees 2 rise up in the air, his eyes flashing like a strobe light. 8 becomes hypnotized.
In a separate room, 1 walks alone in a huff before he becomes startled by a sound. His fear increases when he sees 2 floating eerily towards him. Like 8, 1 becomes hypnotized by 2's flashing eyes. It's revealed that 2's body is actually being used as a puppet by a snakelike Beast, the head of which opens up to reveal a one-eyed skull. The serpentine body, covered in fabric with jointed legs attached to it, picks 1 up and begins to tie him in thread. Already stuffed inside the Snake, 8 lies still. As 1 is reeled in, 5 and 9 rush out to his rescue. The Snake uses 2 again in an attempt to hypnotize them as well but 9 averts his eyes. 5, however, becomes entranced and is rooted to the spot. Just then, 7's spear hits 2 and embeds him in a wall nearby, stopping the hypnotic flashing. 7 runs towards 2's body, dodging the Snake's attacks and retrieves her spear before cutting the Snake's tail from 2's form. The Snake grabs hold of her and 5 suddenly snaps out of his trance. He shoots the Snake in its one eye, causing it to retreat and slither away with 7 and 8. 7 screams out to 9 but the Snake escapes.
1 is safe but 9 tells him that the Snake has taken 7 and 8. 9 proposes that they rescue them but 1 refuses. Still, 9 manages to persuade him. They perform funerary rites for 2 and fit him on a raft with coins over his eyes, letting him float freely into the sewers before they head off towards the factory. With his torch-staff, 9 goes inside alone. He tells 5 that if he doesn't return, 5 is to destroy the factory.
Inside, 9 watches as the Snake hands 8 over to the Brain. 8's life force is drained into the Brain, making it more powerful. As the Snake reaches for 7, 9 ties a threat around a bolt and tosses it over a ledge between a pair of moving cogs. He is able to distract the Snake which places 7 back inside itself as it goes after 9. Through its one broken eye, it lunges at what it thinks is a ragdoll and begins tying it up. The 'doll' is actually a piece of burlap fabric wrapped around the torch-staff. When the Snake inadvertently turns the light on the staff on, it recoils from the light. 9 then burst out of his hiding place and runs with a knife in his mouth. Finally seeing him, the Snake gives chase. The dummy ragdoll, tied to the cabled bolt, is pulled along by the Snake until the cable is caught in the moving cogs, yanking the Snake back. At that, 9 turns around and runs up to the Snake, pulled upward by the cable. 9 uses his knife to slash open the Snake's fabric body, freeing 7. The Snake is pulled up and into the cogs where its head is crushed.
Outside, 1 and 5 prepare to push a barrel full of fuel inside the tunnel. 1 is all for getting it done immediately, but 5 wants to wait for 7 and 9. They are then noticed by a recon drone. Using 5's grappling gun, they rope it and start to pull it down.
Inside, 7 and 9 are spotted by the Brain which sends mechanical spiders after them. 7 and 9 sprint into the tunnel and yell for the ragdolls outside to send in the barrel. 1 and 5 light the fuse and push the barrel into the tunnel. It is immediately followed by the drone which they have tied to the barrel. As the barrel and drone roll down the tunnel, 7 and 9 dodge it before escaping just in time; the barrel knocks back all of the mechanical spiders and falls into the factory where the Brain can only watch helplessly before it explodes. The factory erupts in flames as the ragdolls escape.
The ecstatic ragdolls start to celebrate and 3 and 4 put on a record player, though 1 feels a bit downcast. As 5 chases a runaway LP record he notices, to his horror, that the Brain is still alive. Mobile, it chases him up the hill. 9 tries to run to 5's rescue but 1 suddenly restrains him. The Brain grabs 5 and drains his life force, regaining its strength.
The ragdolls run towards a rickety bridge with the Brain in close pursuit. 6 then notices that the ragdolls absorbed by the Brain have actually had their souls trapped inside of it. While they are able to run easily across the bridge, the Brain proves too heavy and the bridge gives way under it. As it tries to pull itself up, 6 tells the other ragdolls not to destroy it or else their friends will be trapped inside it forever. The Brain loses its grip and falls but manages to grasp 6 and pulls him down with it. 6 cries out for the others to go to the First Room for the Source before the Brain drains his soul.
Safe for the moment, 9 tells the others that he wants to abide by 6's wishes and go to the First Room, but the others are more intent on destroying the Brain once and for all. 9 decides to run to the First Room alone, where he finds schematics for the Brain and for the ragdolls themselves. He discoveres a holographic projector marked '9' and turns it on. An image of the Scientist appears and the man tells 9 about the Brain, a creation made up primarily of his own intelligence. He then tells 9 that he and the other ragdolls are vessels containing pieces of the Scientist's very soul, each representing a part of his personality. 9 was his last creation before he finally died. He shows 9 the Talisman and the sequence needed to turn the Brain off permanently.
With this knowledge, 9 returns to the others who are busy hurling bombs at the rapidly advancing Brain. 9 tells them that the Scientist is the Source but 1 continues to throw bombs. As the Brain gets closer, the dolls run and watch as the Brain becomes stuck in barbed wire, giving them time to hide in a tunnel. 9 informs the others that they have to remove the Talisman from the Brain, which suddenly sets fire to a box of bullets in the tunnel, causing a huge explosion. The ragdolls fall scattered, bruised but alive. 1, however, has lost a few fingers. 9 bravely faces the Brain and, just before he is drained, is pushed aside by 1 who is sacrificed and drained instead, having been inspired to bravery by 9. 9 then grabs the Talisman from the Brain and hits the sequence shown to him by the Scientist, aiming the Talisman back at the Brain. The Brain screams as the souls are transferred into the Talisman and the machine, soulless, explodes.
3, 4, and 7 emerge and find 9 slumped to the ground, but alive. 7 tells him that he did it, but 9 responds, "Not yet."
The ragdolls light a fire and set 5 positions around it for their fallen friends, each with their respective numbers. 9 hits the sequence on the Talisman and, one by one, the souls of the fallen ragdolls are released, glowing green in the night. 8 is the first out. He smiles at them, followed by 6, 2 and 5, and then by 1. 1 approaches 9 and puts his hand on his shoulder before turning and walking over to his marker on the ground. The spirits then begin to rise together, except for 5 who gives 9 a questioning glance before smiling at 9's assuring nod. He joins the others as they float towards the heavens becoming 5 columns of swirling light in the purple-colored sky. 7 takes 9's hand and tells him that their friends are finally free. The green lights coalesce, penetrating the cloud cover, and disappear in a miniature explosion. It then begins to rain for the first time in ages; a healing start to the rebirth of the planet.
3, 4, 7, and 9 look up together as the rain falls on them and 7 asks 9 what will happen next. 9 answers that he's not sure but that the world is theirs now; it's what they make of it.
As the rain falls, a closeup reveals tiny microorganisms thriving in the water, indicating that life will start again to flourish in the world again ... someday ...