The film opens with a flashback to Gracie Hart's childhood. Gracie (Mary Ashleigh Green) is in a school playground where one boy is bullying another. She steps in and beats up the bully to help the victim (a boy she likes). But instead of being grateful, he feels humiliated at being rescued "by a girl," and gets angry at her. She promptly punches him in the nose and then sulks alone in the playground.
Fast-forward to the present day, and Gracie Hart (Sandra Bullock) is an FBI Special Agent. In the middle of a sting operation, the target starts to choke on some food, and Gracie disobeys her superior's command in order to stop the target from choking. As a result, a member of her squad gets shot, and she is reprimanded by being reassigned to a desk job.
Soon afterwards, the bureau learns that there has been a bomb threat against the 75th annual Miss United States beauty pageant in San Antonio, Texas, which the bureau determines came from the notorious domestic terrorist known as "The Citizen". Gracie's partner, Special Agent Eric Matthews (Benjamin Bratt), is chosen to lead the mission to stop the attack. Despite Eric's position as the lead agent in charge, it is apparent that Gracie is the more capable agent, as Eric is unsure of how to proceed and takes credit for Gracie's suggestions. One of Gracie's suggestions is to put an agent undercover at the pageant. Gracie's male colleagues then proceed to have a bit of fun running the digital images of female agents through a website meant for children to play dress up with their dolls. Despite the immature and chauvinistic actions of the agents, Eric recognizes that Gracie is the female FBI agent best qualified for the undercover job.
Beauty pageant coach Victor Melling (Michael Caine), whose reputation was ruined after his last contestant criticized his methods, teaches the tomboyish Gracie how to dress, walk, and act like a contestant. She is not used to such behavior, however, and sees the pageant and its participants as "outdated and antifeminist". Eventually though Victor and Gracie come to respect each other's strengths. Representing New Jersey as "Gracie Lou Freebush", Gracie impresses the audience by playing the glass harp and demonstrating self-defense techniques during the talent competition. She also unexpectedly becomes friends with the other contestants.
Several suspects emerge, including the corrupt competition director and former pageant winner Kathy Morningside (Candice Bergen); her unpleasant assistant Frank Tobin (Steve Monroe); the veteran pageant MC Stan Fields (William Shatner) who, like Kathy, is being replaced with a younger person; and Miss Rhode Island—Cheryl Frasier (Heather Burns), who appears to have a history as a radical animal rights activist. The Citizen is arrested elsewhere on an unrelated charge. Gracie begins to suspect Kathy Morningside and is worried about the safety of the girls. Her boss thinks that her suspicions are groundless and that the pageant is out of danger now that the Citizen has been arrested. He calls off the mission. But Gracie opts to turn in her badge and gun and continue the investigation alone. Eric initially fails to support Gracie, and is about to return to the bureau when he figures out that Gracie's suspicions must be correct, and returns to help her.
In the final round of the pageant, Gracie earns second place while Cheryl becomes Miss United States. Gracie realizes that Kathy Morningside and Frank Tobin—who unbeknownst to anyone is Kathy's son—impersonated the Citizen and made the threat. Because she was going to be fired after the pageant was over, Kathy and her son were planning to murder the newly crowned pageant winner on stage by putting an explosive device in her tiara, and they hoped to let Gracie take the blame. However, instead, Gracie and Eric save the day and arrest Kathy and her son. Gracie's fellow contestants choose her as "Miss Congeniality," and, as the story ends, a romance blooms between Gracie and Eric.