The movie opens with Charlie (Logan Lerman) writing a letter to an anonymous pen pal, discussing his upcoming first day in high school. On his first day, he is harassed by classmates but befriends his English teacher, Mr. Anderson (Paul Rudd).
Charlie attends a school football game alone and notices the flamboyant Patrick (Ezra Miller), who is the only senior in his freshman shop class. Patrick asks Charlie to sit with him. They are joined by Patrick's stepsister Sam (Emma Watson), and Charlie immediately notices her beauty. Upon arriving home, he witnesses Candace's boyfriend hitting her, something Charlie is especially sensitive about as his Aunt Helen (Melanie Lynskey) was also abused. Candace persuades him not to tell their parents. Charlie dances with Sam and Patrick at homecoming and goes to a party with them afterwards. There, he meets their other friends, Bob, Mary Elizabeth, and Alice. He also sees Sam with her boyfriend Craig, which makes him jealous. He eats a pot brownie, and the group is amused by his observations. While in the kitchen, Charlie tells Sam that his best friend Michael shot himself last May. He then goes upstairs to the bathroom, leaving Sam shocked.
Upstairs, Charlie sees Patrick and Brad (Johnny Simmons), the school's star football player, kissing. Patrick tells Charlie that Brad doesn't want anyone to know about their relationship (as his father would disapprove) and asks him to keep it a secret. Still high, Charlie agrees. Later, Sam whispers to Patrick about what Charlie has gone through and they welcome him in their group of friends.
While driving him home, Sam hears a song from the radio and demands that Patrick drive through a tunnel. She stands up in the back of the pickup truck and sways like she's dancing. Again, Charlie is stunned by her beauty.
As Christmas draws closer, Charlie helps Sam to study for her SATs and their friends participate in a Secret Santa gift exchange. On the last night of the exchange, Sam takes Charlie into her room and shows him her gift for him, a typewriter. The two start talking about first kisses. Charlie says that he has never kissed a girl, and Sam reveals that her first kiss was from her father's boss, who was molesting her. She tells Charlie that she wants his first kiss to be with somebody who loves him, and the two kiss.
Charlie's Birthday(which is on Christmas Eve) arrives, and he remembers his Aunt Helen, who died on the same night in a car accident after getting him a present. Later, at a New Year's Eve party, he takes LSD and has more flashbacks to the night his aunt died. He is eventually found passed out in the snow by the police.
Charlie attends the Sadie Hawkins dance with Mary Elizabeth. Afterwards, they go to her house and make out. She then declares that he is her boyfriend. He has no interest in her but continues the relationship because he doesn't know how to break up with her.
While playing truth or dare at a party, Patrick dares Charlie to kiss the prettiest girl in the room, and he kisses Sam rather than Mary Elizabeth. Both girls are enraged, and Patrick tells Charlie to stay away until things cool down.
Weeks pass and his friends are still ignoring him. In addition, his flashbacks to the night his aunt died are getting worse. Bob tells Charlie that Brad's father caught him and Patrick kissing. Brad comes to school with a bruise on his face but claims he was jumped in a parking lot. Patrick and Brad fight in the cafeteria after Brad calls him a "faggot." Brad's friends then begin to beat up Patrick, until Charlie intervenes. Afterwards, he reconciles with his friends.
Patrick is upset after breaking up with Brad and he and Charlie become closer. One night, Patrick kisses Charlie to no reaction, then breaks down because of his unhappiness. Sam breaks up with Craig after finding out he has been cheating on her.
Graduation nears and Sam is accepted to Penn State. After her going away party, Charlie helps her pack. Sam then asks Charlie why he never asked her out. After several heartfelt confessions, they begin to kiss, but Charlie pulls away when Sam touches his inner thigh. She asks him what's wrong, but he tells her that nothing's wrong and continues to kiss her.
The next day, Charlie is unnerved as he watches Sam leave for school. When he arrives at his empty home, he begins to have a breakdown, flashing back to the memory of his Aunt Helen touching his thigh. He calls Candace and tells her it's his fault their aunt died, and that maybe he wanted her to die. Candace tells her friends to dispatch police on their house. Before Charlie can hurt himself, the police arrives and he blacks out.
He wakes up in the hospital. His physician, Dr. Burton (Joan Cusack) explains to Charlie's parents (Dylan McDermott and Kate Walsh) that his Aunt Helen was sexually abusing him, and that Charlie repressed the memory because he blamed himself for her death. After Charlie is discharged from the hospital a few weeks later, Sam and Patrick visit him and take him to their favorite restaurant.
They once again drive into the tunnel, and Sam tells Charlie that she finally found the song that was playing the last time they were there. Charlie climbs into the back of the truck and reminisces about life as whole. He kisses Sam, stands up and screams as they exit the tunnel.