May 3, 1962 begins the same as every other school day for Tracy Turnblad (Nikki Blonsky), an overweight high school student from Baltimore, Maryland. She endures a day's worth of boring classes so that she and her best friend Penny Pingleton (Amanda Bynes) can race home to catch their favorite TV program, The Corny Collins Show. The program, a teen dance show, is broadcast from Baltimore's station WYZT on weekday afternoons.
Some of the teenagers featured on the show also attend Tracy and Penny's school, in particular snobby rich girl Amber Von Tussle (Brittany Snow) and her heartthrob boyfriend Link Larkin (Zac Efron), with whom Tracy is madly in love. Amber's mother Velma (Michelle Pfeiffer) manages station WYZT, and goes out of her way to make sure Amber is prominently featured and that Corny Collins remains a segregated program. Corny Collins (James Marsden) and all of his "Council Kids" are white; black kids are only allowed on Corny Collins on "Negro Day", held the last Tuesday of each month and hosted by local R&B radio DJ Motormouth Maybelle (Queen Latifah).
Neither Tracy's plus-sized shut-in laundress mother Edna (John Travolta) nor Penny's strict Catholic mother Prudy (Allison Janney) approve of their daughters basing their lives around a TV show, particularly one where teens dance to "race music". Tracy's father Wilbur (Christopher Walken), a joke-shop proprietor, is far more lenient. On one day's show, Corny Collins announces that one of his "Council Kids" is going on a leave of absence, and auditions for a replacement will be held the next morning - during school hours. However, Velma turns Tracy away at the audition for being overweight and supportive of integration. Tracy is sent to detention for skipping school, but finds that detention hall is where the black kids hang out and dance. Tracy befriends the detention hall's best dancer, Motormouth Maybelle's son Seaweed (Elijah Kelley), who teaches Tracy several R&B dance moves. These moves secure Tracy a spot on The Corny Collins Show.
Tracy quickly becomes one of Corny's most popular Council Kids and a threat to Velma's quest to have Amber win the show's yearly "Miss Teenage Hairspray" pageant. In addition, Tracy also becomes a threat to Amber's courtship with Link, as he becomes increasingly fond of Tracy and less so of Amber. Tracy's popularity earns her a sponsorship offer from clothes salesman Mr. Pinky (Jerry Stiller), who wants Tracy to be the spokesgirl for his "Hefty Hideaway" boutique for plus-sized women. Tracy convinces Edna to accompany her to the Hefty Hideaway and act as her negotiating agent, and in the process brings her mother's days as an agoraphobe to an end.
At school, Tracy eventually introduces Seaweed to Penny, and the two are instantly smitten with each other. One afternoon after Amber deliberately gets Tracy sent to detention, Link gets himself deliberately sent there in support of her. There Seaweed invites the girls and Link to follow him and his sister Little Inez (Taylor Parks) to a platter party at Motormouth Maybelle's record shop. At the party, Maybelle informs everyone that Velma has canceled Negro Day. Tracy suggests that Maybelle and the others stage a protest march, which they plan for the next afternoon, a day before the Miss Teenage Hairspray pageant. Link, scheduled to sing at the pageant and worried about his budding career, backs out of the demonstration and accidentally offends Tracy in the process.
The next morning, Tracy sneaks out of the house to join the protest march, which comes to a halt at a police roadblock set up by Velma. The entire company of protesters is arrested, although Tracy manages to escape. She flees to the Pingletons' house, where Penny lets her hide out in a basement fallout shelter. However, Prudy discovers Tracy and calls the police, tying Penny to her bed upstairs with a jump rope. Seaweed and a few of the other detention kids (having been bailed out by Wilbur) arrive and help Tracy and Penny escape, and the kids concoct a plan to crash the Miss Teenage Hairspray pageant. Meanwhile, Link visits Tracy's house in order to look for her, and realizes that he is as much in love with her as she is with him. Seaweed and Penny also acknowledge their love during the escape from her house.
With the pageant underway, Velma, leaving nothing to chance, places policemen around and inside station WYZT in order to prevent Tracy from entering. In addition, Velma switches the tallies from the pageant's phone lines so that Amber is guaranteed to win. Penny arrives at the pageant with an incognito Edna, while Wilbur, Seaweed, and the Detention Kids help Tracy sneak past the police and into the studio in time to participate in the Miss Teenage Hairspray dance-off. Link breaks away from Amber to dance with Tracy; then he pulls Inez, who has just arrived at WYZT with Maybelle, to the stage to dance for the pageant.
Against all expectations, Inez receives the most votes and wins the pageant, officially integrating The Corny Collins Show. A perturbed Velma loudly declares her frustration, informing her daughter of the tally-switching scheme. Unknown to Velma, Edna has turned a camera on her, and Velma's outburst is broadcast live on the air, getting her fired. Meanwhile, The Corny Collins Show set explodes into a celebration as Link and Tracy cement their love with a kiss.