The movie opens with 9 (Elijah Wood), a stitchpunk, awakening in a laboratory, unable to speak. Exploring, he finds an odd talisman which he stores in his body, and the remains of the scientist. He climbs to the window, opens it and sees someone down on the ground. Quickly, he rushes to the outside world to find him, passing a truck with a dead mother and child and even walking over a dead soldier. Soon after he finds 2 (Martin Landau), who is amazed at how well 9 was put together. He soon installs a voice mechanism in 9, allowing him to speak. 2 begins to explain that there are others around when suddenly, they are attacked by the Cat Beast. 9 hides in a can, while 2 attempts to fend it off, but to no avail. 2 is knocked out, and the beast notices 9 in the can. He claws at it, in the process nearly cutting off 9's left arm.
9 escapes when 2 gets up and distracts the beast, and shortly after, 9 watches his new friend being carried off towards a towering structure in the distance by the beast, who also has taken the talisman. 9 tries to follow but collapses. Meanwhile, 5 (John C. Reilly) watches from a high tower not too far away.
9 awakens again, this time being repaired by 5-- he freaks out, yet 5 manages to reassure him that everything is alright. Just as he tries to explain what happened to 2, the leader 1 (Christopher Plummer), and his bodyguard, 8 (Fred Tatasciore), enter the room. 9 pleads that they must save 2, but 1 argues that there is no point. He takes 9 to the upper floor of their hideout, revealed to be a ruined church. 1 tells 9 that when all of the others awoke, it was in a time of war, when machine turned against man and they struggled to survive (resulting in 5 having his left eye destroyed) before the world finally quieted down except for the cat beast. 9 continues to insist on finding 2, but 1 is stubborn and cannot be swayed. As they leave the room, 6 (Crispin Glover) can be seen drawing a picture erratically.
5 and 9 head to the watchtower, where 9 recognizes the building where 2 was taken (a large factory), and shows it to 5. Finally, they decide to go forth and bring 2 back home. As they travel to the factory a sandstorm starts up, in which they lose their map. 5 chases after it, and 9 follows 5, yet they lose it anyways. 5 considers turning back, yet the wind is so strong, this is not possible. They find the tunnel they were looking for, and go inside after 9 turns 2's weapon into a staff with a light bulb on top, so they can see. The map they lost is now discovered by a mysterious figure.
7 takes them back to her hideout, where the mute twins, 3 and 4, seem overjoyed to see them all (except 9, who they hide from at first, and then are interested in after 7 tells them that he is okay). The twins reveal more about the war and the background of the Chancellor (Tom Kane) using the Scientist’s (Alan Oppenheimer) B.R.A.I.N. machine to create machines of "peace", which end up actually being for war. 9 asks the twins about the symbols on the talisman (which they know nothing about), so to explain, he draws the symbols on a paper-- 5 recognizes them, claiming that 6 draws the same thing incessantly. 5 and 9 head to the first hideout to speak with 6. Meanwhile, the Fabrication Machine is shown creating a horrible monster from parts laying around the wrecked lab (Including a human skeleton), and the Winged Beast is born.
When they reach a new resting spot, it is revealed that 1 sent 2 out into the “emptiness” to die, because he had been asking too many questions and knew too much. 8 Is outside holding a magnet close to his head which made him giggle. He hears odd sounds on multiple occasions, and at one point goes to check it out. A shadowy figure is seen lurking around, and then 8 is shown, scared, staring into flickering blue lights (it is not shown where these are from yet). After an argument (including 7 nearly killing 1), 1 heads off by himself, only to come face to face with a shadowy figure which looks like 2. He is shocked, and so screams and stares into the eyes, which emit the same flickering blue lights as before with 8, which ultimately leave him helpless. The others come to his aid, and fight the creature unsuccessfully (releasing 2, but 7 and 8 having been taken instead). The others decide to go after 7 and 8, which 1 disagrees with, but has no choice matter, so tags along anyways.
The stitchpunks arrive at the factory. 9 decides to go in alone, and tells 5 to destroy the factory if he does not return. 5 sees a pool of oil, and gets an idea about how to do that. 9 goes in and sees 8 get his spirit sucked out by the talisman on the B.R.A.I.N. machine. 9 makes a trap by putting a cloth with eye and mouth shaped holes cut into it over the staff with the light bulb, and ties a rope to it, and a nut to the end of the rope. He throws the nut over towards some moving gears, and it lands on a ledge above them. Then, he holds the dummy up, which the seamstress attacks, thinking it’s one of the stitchpunks. It starts to sew/tie it up, when 9 turns on the light bulb, momentarily blinding the seamstress. He runs to get a weapon that is lying around. The nut falls into the gears and gets caught, which pulls on the rope, in turn pulling the seamstress closer and closer to the gears. 9 Jumps at it with a knife and cuts it open, releasing 7 from the seamstress’ insides just in the nick of time. The seamstress is immediately crushed by the gears. The B.R.A.I.N. machine notices this and sends Spider Machines after 7 and 9, who are now crawling up into a drainage pipe to escape.
Meanwhile, on the outside, the other stitchpunks find a gasoline barrel and roll it to the drainage pipe entrance on the factory. 1 gets anxious and tells them to blow the place up, but 5 tells him that 9 hasn't had enough time yet. 1 then sees the red eyes of some spider machines going after 7 and 9. He snatches a match from 5 and lights it, then attempts to light the barrel, yet struggles with 5, who takes it away from him. As 9 and 7 are closer to the end of the tunnel, 5 lights the barrel and sends it rolling into the factory. 7 and 9 dodge it and run out a safe distance from the factory with the others. The barrel explodes, blowing the factory and the Fabrication machine up.
When he returns to his birthplace, he finds papers lying around the room, and finds one about making stitchpunks. The wind blows this paper away, revealing a box addressed to 9 (in the dead hand of the Scientist), which he opens. It plays a video of the Scientist explaining that the stitchpunks are each parts of his personality and soul. Also, he shows 9 how to disarm the talisman. After this, he closes the box, but we see then the scientist hooking wires up from 9 to the talisman and then putting a mask over his face directly in front of it. His last bit of soul is then transferred to 9, and he collapses.
9 returns to the others, as they shoot at the B.R.A.I.N. Machine with a big gun. The machine gets ever closer, and 9 tells them to stop firing, but they keep on going. He then explains that 6 was right, that the others are trapped inside the talisman, and that he knows how to free them. The B.R.A.I.N. machine is now very close, and they shoot in the side, which disables it for a moment, but its not yet dead. They run into the same cave from earlier, and hide under a box of ammo. 9 shows the others how to reverse the talisman. The Machine finds them and shoots flames at them. They escape, with ammo and shells going off behind them. The Machine crawls over the cave and appears behind them. Then, 9 tries to sacrifice himself so that 7 can reverse the talisman and destroy the machine. As the B.R.A.I.N. machine closes its eye getting ready to take 9's soul, 1 pushes him out of the way after remembering "sometimes one must be sacrificed..." and instead, his soul is taken. This gives 9 the opportunity to take the talisman and suck the machines life out. The main part of the B.R.A.I.N. Machine (the eye) explodes, and the rest falls, nearly crushing 9 beneath it.The movie closes with 9 releasing the spirits of 1, 2, 5, 6 and 8 from the talisman at a burial site. Each soul goes into the sky (with 5 looking back), as 9, 7 and the twins look on. After the spirits are released into the cloudy sky, a green light flashes in the clouds, thunder is heard, and it begins to rain. The twins are intrigued by the rain. 7 then asks what happens now, which 9 responds that he doesn't know, only that this world is now theirs. The screen fades as each raindrop shown falls, there are pieces of the stitchpunks' souls in them in the form of Microbes, suggesting new life for the world.