Andy Davis (John Morris) is now 17 years old, and is heading off to college in a few days. However, the fact that Andy has grown from a young boy to a teenager has not been lost on a select few: his toys.
Several of them hold out hope that Andy will play with them at least once before he leaves, but those hopes are soon dashed. As the toys take stock of how many are left, and those that they have lost over the years, their attention is drawn to the last of the Army Men: Sarge (R. Lee Ermey), and two paratroopers. Fearful of being thrown away, they leap out the window into the world beyond, their parachutes taking them who knows where.
This idea soon fills the heads of the remaining toys: Woody, Buzz Lightyear, Jessie, Bullseye, Mr. Potato Head, Mrs. Potato Head, 3 alien squeak toys from Pizza Planet, Slinky Dog, Rex, and Hamm the Piggy Bank.
Several are of the persuasion that Sarge is right, and they'll be tossed out soon, but Woody (Tom Hanks) believes that Andy wouldn't do this, and figures he'll store them in the attic...maybe one day to be played with again when Andy has kids of his own.
The toys' 'staff meeting' is cut short when Andy returns to his room with his mom (Laurie Metcalf) in tow. With only a few days left until he leaves, Andy has not cleaned up his room. Andy's mom is also having Molly (Beatrice Miller) clean her room as well, and tells the two to throw out what they don't want, store extra items in the attic, or donate items to Sunnyside Daycare. From Andy's room, the toys watch as Molly throws her Barbie doll (Jodi Benson) in the donations box, along with some other toys.
Andy finally takes out a black trash bag, and begins to put his old toys into it. When he finally gets to Woody and Buzz (Tim Allen), he hesitates, before putting Woody in a box marked 'College,' and tossing Buzz in the black trash bag. Inside, the toys think they are going to be thrown away, and Woody watches as Andy leaves the room. His panic turns to relief as he sees Andy open the attic door. However, before Andy can go up, he helps Molly move the donations box downstairs. The lapse causes the attic door to close, and Andy's Mom soon after finds the trash bag with the toys. Thinking Andy just left trash laying around, she takes it with another bag to the curb.
Woody looks down the street in horror as the garbage truck slowly makes its way to the curb. Woody jumps out the window, and slides down a pipe to the front lawn...only to see the trash bags thrown into the garbage truck and crushed! Shortly thereafter, Woody notices a recycling bin walking towards the garage. Following it, he is relieved to see that his friends escaped. However, they are now all convinced that Andy meant to throw them away.
Woody tries to explain what really happened, but most of them just feel that he is in denial. Jessie (Joan Cusack) soon notices the box of donations to Sunnyside Daycare, and proposes that they all go there. Everyone eagerly jumps in, except for Woody, who demands that they all return to Andy's room right away. Before he can say anymore, the trunk to the family mini-van closes, and Andy's mom takes the box to Sunnyside.
After arriving at Sunnyside, Andy's mom brings the toys in to the Butterfly Room. Looking through the handle-hole in the box, the toys are excited to see a group of children happily playing with the toys in the room.
After the recess bell sounds and the kids leave the room, the toys eagerly escape from the box, only to meet a very friendly group of toys, excited to see them. The group is soon joined by a strawberry-scented bear named Lotso (Ned Beatty), who soon calls his associate Ken (Michael Keaton) to escort the group around, showing them what Sunnyside has to offer. However, during the course of their tour, Ken soon becomes smitten with Barbie...who soon finds herself drawn to him as well.
Lotso explains that the toys are taken care of, and that due to a neverending supply of kids coming and going, the toys will never be without someone to play with them. Andy's toys eagerly accompany Lotso over to the Caterpillar Room, where he then leaves them to experience their first playtime at Sunnyside. However, Ken and Barbie appear to have gotten along quite well, and Barbie eagerly goes back with Ken and Lotso to the Butterfly Room.
Woody explains that while Sunnyside does seem great, he strongly believes they should go back to Andy. Woody asks Buzz to come back, but Buzz refuses, saying they should stick together. Realizing that the others won't accompany him, Woody sneaks out of Sunnyside, but not before accidentally losing his hat. In the process, a little girl named Bonnie finds him, and takes him home with her.
Back in the Caterpillar Room, recess ends, and the toys get their first playtime...only to find the room filled with noisy screaming toddlers, each of them rambunctious and not as 'delicate' as Andy was. Once the daycare closes, the toys feel there has been some mistake and that they should be in the Butterfly Room instead. Buzz manages to get out of the room, intending to talk to Lotso. However, once outside, his attention is drawn to Ken and several other toys going inside a vending machine.
Buzz follows them, but is caught by a sleepy-eyed doll named Big Baby. Ken and the others take Buzz to the daycare's library and tie him up. Suddenly, Lotso comes across the other toys, and demands that they let Buzz go. Buzz thanks Lotso for helping him out, and makes his request for himself and the other toys to be transferred. Lotso admires Buzz's initiative, but is only willing to consider to have him join the Butterfly Room inhabitants. When Buzz refuses, Lotso orders Buzz held down, and manages to procure a Buzz Lightyear instruction manual from the library. Using it, the group of toys sets Buzz to "demo" mode, putting him back in his deluded space-ranger mode.
Lotso, his compatriots, and Buzz return to the Caterpillar Room, where Buzz subdues his friends, and places them in prison-like storage cages. Lotso then explains how the daycare is run: all newcomers start in the Caterpillar Room. If they survive, they move up to the Butterfly Room.
To set an example about what happens to troublemakers, Lotso has Big Baby take Mr Potato Head out to the playground, and stuff him in "The Box" (a sandbox). Also as a warning, Lotso produces Woody's hat, although he doesn't explain what happened to the toys' friend. Barbie finds out about this shortly, and angrily rebukes Ken. Refusing to be a part of Lotso's plan, she is imprisoned as well.
During the toys' day at Sunnyside, Woody has been in Bonnie's house, being used as part of her imaginative fun and games. During her playtime, Woody grows excited to be part of a real playtime again, but longs to get back to Andy.
Once the household is asleep, Bonnie's toys help Woody access the family computer. Woody is relieved to find that Andy's house is just around the corner. He thanks the toys and tells them that if Bonnie ever outgrows them, they should go to Sunnyside. However, the name causes the toys to look on in fear. The toys explain that Lotso is responsible, and one of Bonnie's toys named Chuckles (Bud Luckey) begins to tell a story.
Lotso, Chuckles, and Big Baby were once owned by a little girl named Daisy. Of the three, she loved Lotso the most. However, one day at a rest stop, the three toys were accidentally left behind. The three eventually made it back to Daisy's house. Lotso and Chuckles managed to look in her window...only to see that Lotso had been replaced. Upon seeing this, something changed inside Lotso, and he declared they had all been replaced (even though there was only proof that he had been replaced). Big Baby wanted to still go back, but Lotso just yelled "She doesn't love you no more," and tore off a necklace around Baby's neck: a plastic heart that said "I belong to Daisy." Secretly, Chuckles kept it.
The three toys went from place-to-place, until finally finding Sunnyside. Lotso took over, and set up his system by which almost any new toy would not survive under the strenuous conditions of the toddlers. Chuckles explains that he eventually was broken at Sunnyside, and Bonnie took him in and repaired him. Realizing the danger his friends are in, Woody decides to break back into the daycare and rescue them.
The next day, Woody manages to sneak into the daycare, and move through the ceiling tiles. Finding his way into a hidden area of the Caterpillar Room, he chances upon a Fisher-Price Chatter Telephone (Teddy Newton). The telephone tells Woody that he should have stayed gone, and that there's no way that he and his friends can get out. Woody thanks him for the concern, but says they have to try. The Chatter Telephone then explains what Woody and his friends will be up against: Lotso's minions manning search lights on the playground, trucks patrolling the halls and the playground, an 8-foot high cinderblock wall, and a cymbal-clanging monkey that monitors the security cameras in the building.
The telephone tells Woody that the only other way out is through a garbage chute across the playground.
Once the toddlers have gone to recess, Woody joins his friends, who tell him about Buzz having been reset, and how they want to get back to Andy. Woody then sets his plan into action. Later that evening, the group springs into action: Mr. Potato Head creates a scene to get put in the box again, this time as a way to get outside and report for the group. Barbie pleads with Ken that she can't take being imprisoned, and Ken lets her out. He takes her back to his dreamhouse, where Barbie subdues him, and using one of his outfits as a disguise, manages to infiltrate the daycare library to find the instruction manual for Buzz. Woody and Slinky Dog manage to infiltrate the main security room, and take down the cymbal-clanging monkey. Rex and Hamm start a fight to distract Buzz, allowing Jessie to escape, and trap Buzz under a plastic tub.
The toys then regroup, and set about trying to get Buzz back to normal. However, a mistake in resetting Buzz sets him to speak and act in Spanish. With little time left, the group decides to worry about fixing him later, and quickly set out to get to the garbage chute.
The gang gets to the end of the chute before plummeting into the dumpster...only to find Lotso, Ken, and his associates waiting (along with the chatter telephone, now broken by the bad toys). Lotso offers the toys a choice: either end up in the dumpster, or return to the daycare. Jessie and Barbie both decry what Lotso has done to the daycare, and even Ken soon turns against Lotso.
The eagerness of the group and Woody to return to Andy incites Lotso to declare that love doesn't exist. It is then that Woody mentions Daisy, and produces the tag that Chuckles had kept. Big Baby sees the tag, and Lotso declares that she didn't love them and replaced them. Woody reminds Lotso that it was only him she replaced. This revelation causes Big Baby to reach for the tag, before Lotso destroys, it, yelling at Big Baby for being stupid and believing that Daisy loved him. Big Baby, feeling betrayed, then throws Lotso in the dumpster.
The other toys begin to run across the lid, before one of the Pizza Planet aliens' feet gets stuck in the lid. Woody goes to help him, only to have Lotso grab his hand. The others rush to help Woody, but just then, a dump truck pulls up, and dumps the contents (including Andy's toys) into the collecting bin in the back. Barbie and Ken, who were not on the dumpster's lid, can only watch as their friends are taken from them.
Inside the dumpster, more trash is emptied onto the group, before a TV set falls on Buzz...which manages to set him back to his proper self. However, before the toys can rejoice, the truck arrives at the Tri-County landfill. As the gang moves about, they are shocked when a bulldozer scoops up the three Pizza Planet aliens, carrying them away! The remaining toys are then shoveled by another machine onto a moving conveyor belt, headed towards a large shredding machine. The toys manage to stave off being shredded by grabbing onto metal objects that are being magnetized to an overhead track. Woody and Buzz even manage to save Lotso, who thanks them.
Once they make it through, they find themselves on another conveyor belt, heading towards what looks like daylight. However, as they draw closer, they soon realize it's a large pit that empties into a fiery incinerator. The toys begin to try to outrun their fiery fate, when Lotso notices an emergency stop switch. He motions for the others to help him, and they help hoist him up to stop the machine. However, once reaching the button, Lotso just smirks at Woody, muttering "Where's your kid now, Sheriff?' and running off.
The toys are soon unable to keep running, and tumble into the pit. They attempt to try and climb out, but there appears to be no escape. With no hope left, the toys all join hands, willing to stay together to the very end.
Suddenly, a blue light appears overhead, and a giant claw falls down, scooping up the group. As they wonder how their rescue was possible, the enormous claw swings by the glass case of the machine, where the three Pizza Planet aliens are. Once the group gets out, they thank their saviors, and wonder what became of Lotso.
Unknown to them, Lotso is found by another garbageman at the dump. Remembering having a Lots-a-Huggin Bear as a kid, he then ties Lotso to the grille of his dump truck as he heads off for duty.
Andy's toys find the dump truck that services Andy's neighborhood and manage to get back in time before Andy leaves for college. After cleaning themselves up, they sneak back into the house, finding Andy's room cleaned out, except for some minimal items, and two boxes: one marked 'College,' the other 'Attic.'
Woody's friends pile into the 'Attic' box, and say their goodbyes. Hearing Andy and his mom approaching, Woody hops in the 'College' box. As they enter Andy's room, his mother is hit with the sad reality that her son is going away. Andy tells her that even though he'll be gone, he'll still care about her.
Hearing this, Woody realizes that Andy can still care for him and the other toys: an example of true love, in that you never forget those you really love. As Andy is distracted by his sister Molly and his dog Buster, Woody quickly grabs a Post-It note and a marker, writing down Bonnie's street address, before hopping in the 'Attic' box.
Andy returns to the room, and sees the note on the 'Attic' box, thinking that his mom wrote it. Andy takes the box to the address and sees Bonnie playing in her family's front yard with the same quirky imagination that he had.
Andy then gets out of the car with his box. As Bonnie sees him approach, she stops her game and calls for her mom. Bonnie's mom recognizes Andy, who then explains that he has some toys for Bonnie. Andy then introduces each of his toys, telling Bonnie a little bit about each of them, since he still remembers how he played with them: for example, Hamm saving your money but also being the "Evil Dr. Porkchop".
With each toy revealed, Bonnie gets more and more brave, until after Buzz, she peeks into the box and sees Woody. Andy has no knowledge of how Woody got in there, but is surprised when Bonnie calls him 'my cowboy doll,' and quotes one of Woody's lines: "There's a snake in my boot!"
Andy sees Bonnie looking at Woody, and explains to her how important Woody is to him: how long he's had him, and how brave Woody can be. However, he explains to Bonnie that she can have Woody, if she promises to take good care of him, and the other toys. When she quietly nods an affirmative, Andy suddenly begins to play with her, and the two are having an imaginative time interacting with their toys. Secretly, Andy's toys are overjoyed at their last playtime with him.
Finally, Andy gets into his car, as Bonnie gathers her old and new toys on the porch. As she holds Woody and Buzz in her little arms, she makes Woody wave goodbye. This causes Andy to give a sad but calming smile. "Thanks, guys," he whispers, as he drives off.
After Andy leaves, Bonnie's mom takes her inside for lunch, leaving the toys on the porch, watching Andy's car fade into the distance down the street. "So long, partner," says Woody. Woody smiles at the other toys, reaffirming that Andy did care for them, and care for them enough to leave them with another child who will take care of them and give them many playtimes to come. Woody then begins to introduce his friends to Bonnie's other toys.
Some time afterward, the toys find a note in Bonnie's backpack from Ken. In the time since Lotso has been gone, Ken and Barbie have worked to abolish the unfair system that ran Sunnyside, and now the toys have an equal opportunity to move between the Caterpillar and Butterfly rooms. The toys at Sunnyside now enjoy their time there, and soon after, Sarge and his two paratroopers arrive, with both Ken and Barbie welcoming them.