After Leo Borlock’s father died, he began to wear a porcupine tie in remembrance of him. At a new school, he was beaten up, and his tie was cut. Since then, on each birthday, he has received a new porcupine tie from an unknown person, but he does not wear them in public. In high school, Leo (Graham Verchere) plays trumpet in the marching band and helps his friend Kevin Singh (Karan Brar), a member of the A.V. club, host an interview show. One day, a free-spirited girl, Stargirl Caraway (Grace VanderWaal), arrives and makes an impression on Leo when she sings “Happy Birthday” to him on a ukulele in front of the school. Later, while their losing football team, the Mudfrogs, are playing, Stargirl performs a song, “Be True to Your School”, that energizes them, and they almost get their first win. Kevin and Leo invite her onto their show, but she politely declines.
Stargirl becomes a good luck charm for the football team when she sings “We Got the Beat”. She begins hanging out with Leo and tries to get him to come out of his shell. Archie (Giancarlo Esposito), the owner of the local paleontologist camp, tells Leo that Stargirl, lives with her single mother and was homeschooled much of her life. She learned about Leo through Archie. Later, Stargirl tries out for the Speech regionals against Kevin and wins with her unusual speech on rats. While anonymously returning a bike to a boy who was in the hospital, Leo mentions the ties, but Stargirl denies any knowledge of it. Stargirl gives a song suggestion to Leo (“Thirteen”) and kisses him for the first time. They begin dating.
During the big game, one of the opposing players is severely injured. Stargirl rides with him to the hospital, confusing everyone. Afterward, Leo tells Stargirl that everyone was demoralized and that they lost. The next day, everyone is disappointed with Stargirl. Leo’s friends are upset, but forgive him and apologize for being distant with him. Kevin invites Stargirl onto his show so to explain herself. Stargirl reveals that her real name is Susan; she chose Stargirl because everyone is made of stardust. The audience of students turns on her when a student named Hillari (Shelby Simmons) scolds her for inconsiderately returning a bike to her brother, who was permanently injured while riding it. Stargirl runs off in tears.
Leo suggests that Stargirl act like everyone else, much to her consternation, but she starts calling herself Susan and wearing clothes like those of her classmates. At the Speech regionals, Leo asks her to the Winter Dance, and she accepts. Stargirl is about to give a speech on internet privacy, but shifts to a speech on flowers, which wins her first place. Although it is the very first trophy won at the school, nobody pays attention to it. Stargirl decides that being Susan betrays her identity. Leo begins to feel awful, but gets encouragement from his mother (Darby Stanchfield) and Kevin.
Stargirl sends Leo her collection of records, a record player and an invite for a “big surprise” at the dance. When Leo arrives, Stargirl reveals her surprise: him singing in front of everyone. Leo reluctantly gets up and performs his and his father’s favorite song, “Just What I Needed”, leading everyone to dance in the courtyard. Stargirl apologizes to Hillari and disappears from the party. Leo discovers that Stargirl moved away, but she has influenced the school in a positive way, and they eventually win more trophies. Leo continues to get ties from Stargirl, and Archie reveals that she collected information on the townsfolk to help them. Even after graduating high school, Leo never forgets what Stargirl did for him (“Give Me Love (Give Me Peace on Earth)”).
In a post-credits scene, at an unspecified time, Stargirl sings a song to Leo (“Today and Tomorrow”).