NOTE: This spoiler was submitted by Jeremy.
A class of young children are doing presentations on former presidents. Up next is 10-year-old Annie Bennett (Quvenzhane Wallis). She decides to do her report on Franklin Delano Roosevelt as a performance piece, and she gets her classmates to join her in stomping their feet and making noises as part of the bit.
Annie runs to a restaurant in the city where she waits for her parents to show up and finally reclaim her. They never come. The restaurant owner gives her cannolis to take home. Annie also stops by a convenience store and gets flowers from the manager Lou (David Zayas) to give to his "lady". Annie gets back to her foster home and climbs up the fire escape to rejoin her foster sisters - Isabella (Eden Duncan-Smith), Tessie (Zoe Margaret Coletti), Mia (Nicolette Pierini), and Pepper (Amanda Troya). They're looked over by the mean Miss Hannigan (Cameron Diaz), who used to be a performer and is now miserable for having to take care of the girls. The girls lament not being adopted ("Maybe").
Hannigan wakes the girls up early on Saturday to make them clean the place up as an inspector from Social Services is set to arrive. They sing "It's The Hard Knock Life" as they do their chores. The inspector (Mike Birbiglia) comes over, and Hannigan flirts with him. After he leaves the room, the girls notice that he dropped a document containing their records. Annie takes it and seizes the opportunity to seek out her real parents. She makes an excuse with Hannigan to go out and do something while she goes on her mission. Annie stops by Lou's to do some work to get the money needed to get the documents.
We meet Mr. Will Stacks (Jamie Foxx), a cell phone mogul who is running for mayor of New York City. With him is his hotshot adviser Guy (Bobby Cannavale), his assistant Grace (Rose Byrne), and bodyguard Nash (Adewale Akinnouye-Agbaje). Will is a germaphobe and also not very popular with voters compared to the current favorite Harold Gray (Peter Van Wagner). Will goes to feed the homeless and tries to eat the mashed potatoes to show how much he cares, only for him to spit it out in the face of a homeless man...three times.
Annie is unable to learn anything about her parents since she's not in the system. She walks home singing "Tomorrow". After the song, she sees two boys chasing a dog and throwing things at it. Annie chases after them and yells at them to stop. At the same time, Will is walking down the street. Annie accidentally bumps into him and falls into the street. Will grabs her and pulls her up right before a van drives by.
A video of Will's heroic act hits the web, and he moves up several points in the race. Guy suggests to him that he find Annie and use her to make himself look good for the public. Will sends Grace to the foster home to find Annie. She takes her back to Will's place, where, on the way, she sees the video of her rescue.
Annie meets Will again, and he offers her to stay there for a bit. She knows there's a catch, and he admits the plan. She jokes that he could be president if she moved in. The adults get somebody to approve the temporary guardianship for Will. Annie then takes a tour around the place and is impressed with everything ("I Think I'm Gonna Like It Here").
Will sets the plan in motion by taking Annie out to do whatever she wants. They adopt the dog from the streets (to Will's dismay), and Annie names it Sandy. He later takes Annie and the foster girls to the premiere of a cheesy movie (with cameos from Mila Kunis, Ashton Kutcher, and Rihanna), and then to buy a bunch of things for the girls. The girls are taken back to the foster home, and Hannigan orders them to take back all the nice things they got (they don't). She once again bemoans her current position in life ("Little Girls").
Gray gets endorsed by Michael J. Fox, leading Will to get a bit desperate. He decides to take Annie on a ride over the city in his chopper ("The City's Yours"). Annie is pleased.
Annie joins Will and company at an event. Will invites Annie up on stage for the people to see her in her pretty red dress. She starts to sing "Opportunity", and the orchestra joins in. After the performance, Guy tells Annie to read a speech that he wrote up. Annie is quiet and leaves the stage upset. Will and Grace (ha) run after her, and Annie admits that she doesn't know how to read. Will says he will get her a tutor.
After talking to Will, Guy devises a plan to get Annie's real parents...or rather, people to pretend to be her parents to get her off Will's hands. Guy teams up with Hannigan to set their scheme in motion ("Easy Street"), because, if Will looks heroic and reunites Annie with her parents, Guy gets a nice payday to look forward to. Hannigan later auditions a bunch of (horrible) actors to play the part, and she is not pleased with any of them.
Will tucks Annie into bed. Grace realizes that Will has grown to care for her. She tells him his secret is safe with her.
Will later asks Grace what it would take to properly adopt Annie. That's when Guy comes in and says that Annie's real parents have been found. Annie is happy, though Will is visibly sad. Annie is taken to the restaurant where she's always waited for her parents to meet two fake parents (Tracie Thoms and Dorian Missick). They appear to have the other half of the locket around Annie's neck to confirm it. After they take Annie with them, Hannigan passes by the restaurant and decides she's unhappy with Guy over the decision to let Annie go off with two strangers. She, Will, and Annie all seem to feel a certain inner conflict right about now ("Who Am I?"). Hannigan then approaches the foster girls and asks for their help.
Annie leaves Will's home to go with the fake parents. Hannigan arrives too late with the girls and Lou to tell Will and Grace that those aren't Annie's real parents and that Guy set it up. Will has his people call the police and be on the lookout for Annie and the car that she's in. They run off to save her, but not before Grace punches Guy in the face.
Annie asks the fake parents where they're going, and they respond rudely and indifferently. They make her think that Will knowingly dumped her on them, and she realizes they aren't her real parents.
She starts to call out for help to anybody that sees her. The kids that see her take pictures of her and post them to Instagram and Twitter. This lets Annie's foster sisters to get a hold on her current location. They go with the adults in Will's chopper before spotting them over the George Washington Bridge. The police are also hot on their trail. The fake dad drives through the park before Will's pilot lands the chopper in front of them. The fake parents try and make a run for it, but the police tackle them to the ground.
Will goes to Annie, who is mad since she thinks he abandoned her. Will apologizes and admits he didn't know that those people were fakes. The press arrives on the scene. To prove he really cares, Will officially withdraws from the mayoral race and decides to focus on raising Annie. Annie forgives him, but she decides one more thing needs to happen. She sets brings Grace toward Will, and he decides to formally ask her out to dinner. She responds by kissing him. The three of them then sing "I Don't Need Anything But You."
Will sets up a literacy center in the city, with Annie finally being able to read a speech. The film concludes with the whole cast singing a reprise of "Tomorrow".