Jenna Rink is an unpopular girl celebrating her 13th birthday on May 26, 1987 and wishes to overcome her unpopularity at school since she views herself as gawky and uncool.
Jenna especially wants to join the "Six Chicks", a school clique led by Lucy "Tom-Tom" Wyman who takes advantage of Jenna's desire to fit in by manipulating her into doing a school assignment.
Before her birthday party, Jenna's best friend Matty Flamhaff (Sean Marquette) gives her a doll dream house that he built for her, and a packet of "magic wishing dust", which he sprinkles on the roof of the house.
Tom-Tom and the rest of the six chicks show up to Jenna's house party where they play a cruel practical joke on her during a game of "Seven Minutes in Heaven".
Jenna, mistakenly thinking Matt was responsible, yells at him and barricades herself in the closet where she put the Dream House.
She cries and rocks backs and forth, bumping into the wall, wishing to be "30, flirty, and thriving". The wishing dust from the dollhouse sprinkles on her, causing her to fall asleep.
The next morning, Jenna awakens in a 30-year-old woman's body (Jennifer Garner) living in a Fifth Avenue apartment. It is now 2004, and Jenna has no memory of the 17 years that have passed since her 13th birthday.
30-year old Jenna's best friend, Lucy drives her to her work office. Soon, Jenna discovers she works for Poise, her favorite fashion magazine from when she was a teenager.
Missing her best friend from 1987, Jenna asks her assistant to track down Matt. To her dismay, Jenna learns she and "Matty" have been estranged since high school when Jenna fell in with the in-crowd and became best friends with Tom-Tom, who now goes by her real name Lucy. Matt (Mark Ruffalo) is now a struggling photographer who's engaged.
After Jenna overhears Lucy badmouthing her to a co-worker, she sadly realizes that what she thought she wanted wasn't important after all.
This is complicated by the fact that Jenna has become a shadow of her former self. She has lost almost all contact with her parents, and is having an affair with the husband of a colleague.
Not only is she generally hated by her co-workers and anyone else she has worked with, she is suspected of giving her magazine's ideas to a rival publication, Sparkle.
Jenna slowly realizes that the person she has become is neither trustworthy nor likable, and unknowingly begins to reverse the situation by distancing herself from her new, shallow boyfriend.
From this point on, all of Jenna's work to rebuild her life as a 30-year-old woman has gone to waste.
Jenna heads back to her hometown in New Jersey and, while her parents are out, hides in the same closet as 17 years before and cries.
Her parents return and find her hiding, and they welcome her in for the night. The next day, she reminisces by looking through school yearbooks and other items from her school days and catch-up on the 17 years she doesn't remember.
These inspire her on her return to Manhattan. Over several outings and working together on a magazine project, Jenna becomes friends with Matt again, asking his help for her project.
Although Matt is engaged and Jenna has a boyfriend, they kiss during a nighttime walk.
After arranging a magazine photo shoot with Matt, then making a successful presentation for a planned revamp for Poise, Jenna prepares for the revamp when she gets bad news from the publisher: Poise is shutting down because the work she put into the relaunch ended up in Sparkle.
Jenna learns she was responsible for sabotaging Poise from within by sending their material to Sparkle for months. When Lucy learns this, she cons Matt into signing over the photo rights from the relaunch shoot to her.
She accepts the position of Sparkle editor-in-chief, telling Jenna she wants to be both the pot and the kettle in their relationship.
When an already-distraught Jenna discovers Matt is getting married later that day, she rushes to his house and begs him to call off the wedding.
Dazed, Matt realizes he loves Jenna, but cannot change the past. From his closet, he pulls the "dream house" he made 17 years before and gives it back to her. Jenna leaves in tears, crying over the dream house.
Unknown to Jenna, specks of wishing dust remain on the dream house, and as they blow in the wind right to Jenna, she wishes she was 13 again.
When she opens her eyes, she finds herself back in the closet of the basement at her parents' house, 13 years old again and got a second chance. When Matt comes to check on her, she jumps on top of him and kisses him.
She also tells Tom-Tom she can be the pot and kettle all by herself, then rips apart the school project. Seventeen years later, Jenna and Matt are married and live in a house which resembles the dollhouse.