In a Manhattan apartment building, Max’s life as a favorite pet is turned upside-down, when his owner brings home sloppy mongrel Duke. They must put their quarrels aside when they learn that adorable white bunny Snowball is building an army of lost pets determined to wreak revenge.
The film opens in New York City, where a little dog named Max (voice of Louis CK) is going for a bike ride around the park with his owner Katie (voice of Ellie Kemper). Max tells us how Katie found him when he was a puppy, and since then, he's had it good.After Katie leaves for work, Max just sits at the door and waits for her to come home. We meet the other pets that live near Max, including Gidget (voice of Jenny Slate), Chloe (voice of Lake Bell), Mel (voice of Bobby Moynihan), Buddy (voice of Hannibal Buress), and Sweet Pea (voice of Tara Strong). Gidget has a crush on Max, which he is unaware of. Chloe is a fat cat that eats her owner's food instead of her own. Sweet Pea is a little bird that turns on the fan and pretends to fly with jets on TV. We also see Leonard the poodle being left with classic music, but he switches it to a System of a Down song when his owner leaves. Max is visited by Chloe, Buddy, and Mel, along with a lost guinea pig named Norman (voice of Chris Renaud).That night, to Max's horror, Katie brings home a bigger dog named Duke (voice of Eric Stonestreet). Max quickly makes it clear to both Duke and Katie how he feels about Duke being there, but Katie hopes it'll work out between the two of them. Duke overhears Max barking to Katie after Duke tries to sleep in the same bed as Max. Hurt, Duke says he'll do whatever it takes to ensure he stays in this home. He forces Max to sleep on the floor.The next morning, the dogs are left alone after Katie goes to work. Duke eats food from both his bowl and Max's. Duke then runs toward the wall and knocks over a vase. Max takes the opportunity to make a big mess and have Duke blamed for it so Katie can get rid of him.Max and Duke get taken out by a dog walker along with Mel and Buddy. When they are unleashed at the park, Duke calls Max over to a hidden area and then drags him away from the park with no one noticing. They end up in an alley where dozens of cats led by the hairless Ozone (voice of Steve Coogan) antagonize them. They take the dogs' collars from them. Duke runs away and leaves Max behind, only to come back when animal control officers chase after them. Max and Duke get captured.Gidget peeks out her window and sees Mel and Buddy, but no Max. She watches a Spanish soap opera and is inspired to go after her one true love. She runs to the rooftop and finds a hawk named Tiberius (voice of Albert Brooks) in his coop. He tries to eat Gidget at first, but then realizes that's a bad thing. She asks for his help in finding Max so that she can be his best friend. Tiberius flies away immediately.Emerging from the sewers is an adorable bunny named Snowball (voice of Kevin Hart). The animal control officers stop the truck, and one walks over to him. Snowball goes wild and beats the man up while his two lackeys, a lizard and a tattooed pig named…Tattoo (voice of Michael Beattie), attack the other officer. They hijack the truck and ride away. Snowball makes a key out of a carrot and breaks out one dog named Ripper. The truck crashes against a wall. The animals are about to leave Max and Duke behind until they beg to be saved. Snowball says they are part of the Flushed Pets, as they were abandoned by their owners, and he won't save Max and Duke because he knows they're domesticated. The dogs lie about killing their owner to get on Snowball's good side, and he frees them before the truck explodes. Max and Duke follow him into the sewer.Tiberius flies up to the roof with Ozone. He coughs up Max's collar in front of Gidget, but he won't say anything else. Gidget starts slapping Ozone until he admits that he knows Max and Duke are in the sewers. Gidget recruits Mel, Buddy, Chloe, Sweet Pea, and Norman to help find the dogs. Although hesitant at first, Chloe convinces the others to help since Max has helped them out before.Max and Duke are brought into the lair of the Flushed Pets. All of them hate humans for abandoning them, and they plan to wage war against them. Snowball asks the dogs to tell everyone the story of how they killed their owner. Max and Duke make up that they killed her with a blender, which delights Snowball. He brings them to be initiated by getting bitten by a one-fanged viper. Max is the first to go until the alley cats come in and reveal to the Flushed Pets that they just took Max and Duke's collars earlier. The animals sic the viper on the dogs, but they lead the viper to wrap itself around a pipe that causes the brick ceiling to break off and crush it. The dogs escape and are flushed out into the river outside the city. They hop on a ferry that takes them to Brooklyn. Snowball vows to find them and get his revenge.Buddy brings the pets to the home of an elderly dog named Pops (voice of Dana Carvey). Pops has all the pets in the neighborhood over since his owner is rarely around, and Pops knows all the pets in the city. He guides the pets to the roof in his own way toward the sewers. Once they get there, they find the Flushed Pets with Snowball plotting revenge. When both groups learn that they know Max and Duke, the Flushed Pets chase after the house pets. Norman ends up getting captured by a crocodile and is left behind (though he's not too worried about it).Max and Duke make it to Brooklyn, and they are both hungry. Duke sniffs out a sausage factory. The two run in and feast on all the sausages they can find, leading to a weird sequence where they imagine the sausages singing "We Go Together" from "Grease". Afterward, the dogs start to warm up to each other. Duke then talks about his previous owner, an older man named Fred. Fred had Duke since he was a puppy, but Duke ended up running away and was captured by Animal Control until Katie found him. Max decides to go look for Fred to bring Duke home.The dogs find Duke's old home, but they come across a cat telling them to leave. Duke asks about Fred, and the cat says that Fred has died. The family that now lives in the house comes home, and Duke starts barking at them. He gets mad at Max for bringing him there since he knows Max was always trying to get rid of him. Almost immediately, the Animal Control officers show up and take Duke, who lets Max run away. Max instead chases after the truck.While Max goes to save Duke, Snowball comes out of the sewers with Tattoo and the lizard. They spot Max and chase after him, but Tattoo and the lizard get taken. Max and Snowball decide to team up and chase after the truck. They hijack a bus and follow the truck to the Brooklyn Bridge. The bus falls and causes a traffic jam while the truck swerves off the bridge and gets stuck. The Flushed Pets surround the bridge as they find Max pulling Snowball out of the bus, thinking he killed Snowball. Before the Flushed Pets can get Max, the house pets arrive with Gidget riding Tiberius. She proceeds to pound ALL the Flushed Pets by herself, which impresses Max. Max rushes to save Duke, but the truck falls into the river with both dogs in it as Max tries to get the keys. Snowball then plunges into the river and gets the keys back to Max so he can get Duke out, and they all swim to the surface.Tattoo steals a taxi and drives the pets back home. Max tells Gidget how he started to feel after seeing her fight the other animals, and she excitedly starts licking him. The Flushed Pets are about to return to the sewers until a little girl sees Snowball and adopts him, making him happy once again. The other pets return to their owners right before they all get home. Katie comes home and see Max and Duke waiting for her together. She is happy to see the two of them getting along. The three of them then go out onto the fire escape to see the city at night. Max and Duke have now become good friends.During the credits, Mel and Buddy go to a party at the home of Leonard, with Snowball in attendance. Leonard's owner comes home, forcing the animals to scatter. When the owner asks Leonard if he was a good boy, Tattoo falls from the ceiling on a chandelier.