The sequel begins when Riley Anderson is now 18 after the events in the first Inside Out film and her emotions Sadness, Joy, Fear, Disgust, and Anger are busy making memories.
One day, Jordan comes to take Riley ice skating. When Riley gets home for bedtime, Sadness had Dream Duty that night and runs away from Headquarters because she had a nightmare of turning memories sad when Joy tells her not to touch them. In her nightmare, Sadness picks up the memory of the time that Riley and her family singing the gum song. The next day, Joy tells the other emotions that Sadness has gone missing and has left them a note that tells them that she ran away crying from Headquarters, leaving Joy puzzled and Fear worried, which causes Disgust to puke and Anger to lose his cool by banging on the console.
Sadness gets lost in the Long Term Memory maze and tries to get away from Headquarters as fast as possible, so Joy suggests that she leaves Headquarters to look for Sadness and tells Fear, Anger, and Disgust to keep a close eye on Riley while she is at school at UCLA. The Tripledent Gum commercial appears and Anger smashes the console as Fear screams and passes out. Joy asks the forgetters if they have seen Sadness, but they were too busy getting rid of old memories and Joy spots her near Cloud Town, but Sadness runs away from her. As Joy chases her, they end up in the Subconscious to find Riley's greatest fear, Jangles the birthday clown. They suddenly get ambushed and escape on the new Train Of Thought after chasing it. Joy gets on, but Sadness comes up with a great idea by climbing up an electrical tower. Once she reached the top, she gets electrocuted and lands on the track, but Joy grabs her onto the train just in the nick of time after getting her foot caught in between the rails.
That night, Anger has Dream Duty and causes an earthquake near Tragic Vampire Romance Island to crush the train tracks as they start to tilt, but stops inches from falling into the memory dump, but the Train Of Thought collapses as it hits a cliff after some sparks fly as it explodes and bursts into flames as it falls in slow motion just as the two emotions jump off the train onto the ground. Sadness felt scared and started to cry and whimper as she and Joy watch the faded memories burn as the ground started to shift, landing the two into the memory dump, along with the tracks after the fire was put out.
Sadness and Joy were now trapped in hot water. Joy pulls Sadness from the wreckage and tries to launch Sadness out of the dump, but ends up hitting the window of Headquarters and falls back into the dump, knocking her unconscious. When she recovers, Sadness sings and dances with Joy to a song to show how much she cares about Joy, causing fireworks to explode and notices the recall tube, but it breaks, causing them to land on the ground, but Sadness falls back as a core memory lands in the water and traps Joy in a landslide of memories, so Sadness grabs the memory and pulls Joy out and onto the ground. They use an air vent to escape the dump as a explosion of TNT follows them, so Sadness finds a shortcut through a tunnel that leads to the personality islands. They decide to break into Graham Cracker Castle and fight a mind worker to wake up Riley, but Anger causes another quake near Imagination Land, causing it to fall into the dump, but the two emotions make a daring escape across a balancing bridge on a train car from the Train of Thought with lots of fog and lava below the bridge and the bridge snaps loose. They make it to the other side just in the nick of time to get tortured by Jangles in an abandoned mineshaft. Sadness asks him if he did this, but he leaves. After he leaves, they escape through a sewer tunnel that leads to Dream Productions. When Jangles returns, he finds that Joy and Sadness were gone, so he head toward Headquarters to kidnap the other emotions controlling Riley.
They enter Dream Productions by peeking out out of the sewer with a manhole cover on their head, so they wouldn't be seen. Sadness helps Joy up the side of the building by her dress, but when they enter the building, they accidentally interrupt Riley's dream by dropping a bell onto the dream teacher, which falls through the floor and almost kills her. She climbs out and thinks that Sadness and Joy are trying to wake up Riley and trying to kill her, so she calls an angry mob to execute them. The angry mob chases them as rain pours from the night sky. As the angry mob chases them, Joy gets captured, but Sadness escapes with a blurry vision, but the mob close behind. She jumps over Boy Band Island just as the it falls into the dump. The mob retreats as Sadness lands on Friendly Argument Island and snickers around a corner as she tries to find Joy. Sadness hides in Cloud Town, which was the only part still standing in Imagination Land.
Jangles sends a message to Sadness by telling her that he has captured the other three emotions during a home invasion and to find him before Riley wakes up. Shocked, Sadness knew that he was up to something bad and heads back to Headquarters. She hides just as the angry mob tries to find her and notice the recall tube that Sadness was in, so she sneaks into the light bulb department as the angry mob breaks into Headquarters and are trying to kill her and get locked out by Sadness. She finds water spraying out of the screen as it cracks, causing water pipe lines to explodea massive flood and all the islands to go out of power, causing Gloom to take control of the console as the core memories to fall out of their proper places. Sadness climbs up onto tthe console and spats out some water. Sadness trips, drops some memory orbs, and rolls under the staircase. She accidentally activates the console and makes a sad core memory without noticing the "Do Not Touch" sign, but the angry mob charges in and surrounds Sadness just as she turns into a giant, which causes Headquarters to crumble, fall into the dump, and scare the angry mob away. Sadness then realizes that she forgot about her friends and that they need her help and Headquarters was completely destroyed and surrounded by caution tape.
Meanwhile, Jangles has the other emotions held hostage. Sadness marches down the Long Term Memory and finds them in the nick of time. Jangles was fed up with Sadness, so he shoots fireballs at her and knocks her down, but gets distracted by mind workers and shoots a big fireball at them. Sadness punches him across the Long Term Memory, but he returns and fires a missile into Sadness' mouth. She sacrifices herself to save her friends by grabbing on tightly to Jangles as the missile in her mouth explodes. After the explosion, Sadness is back to normal and alive, but ends up slamming into Honesty Island. Later, she leads her friends home into the sunset.
One year later, the emotions build a new headquarters and Riley is now 19 and back to normal. Sadness apologizes to Joy for running away and Joy forgives her. They slide down the banister and see the others at the console to help Riley. Later, Sadness holds a meeting with the mind workers and celebrates her emotional reunion back at Headquarters.
During the credits the emotion silhouettes do some bloopers while commenting. After the credits, Jangles fades away in the memory dump and crushes the camera with his mallet at the end of the sequel, leading Joy and Sadness to blow up the subconscious with dynamite as the screen cuts to black.