In 1912, a con artist named Harold Hill arrives in River City, Iowa, greeted with sneers from its citizens. He quickly finds an ally in his friend Marcellus Washburn, who warns him about the town librarian and moral watchdog, Marian Paroo. Hill asks Marcellus if there is any news in the city, and Marcellus tells him that the town bought a pool table for the billiard hall. Hill seizes on this to warn parents that the pool table will bring havoc to their town, using the rumor to plant doubt about signs of moral decline.
Marian Paroo teaches a piano lesson to her student Amaryllis and argues with her mother about her stubbornness to get married. Marian Paroo and Amaryllis both vow to say goodnight to their “someones” until they find someone to love, a small ritual that underscores the town’s slow, hopeful romance beneath the surface tension.
Later, during a town meeting, Hill steals the spotlight to advertise for his new boys' band in River City. After the meeting, Hill sends town hooligan Tommy Djilas on a date with Zaneeta Shinn, unaware that she is the mayor's daughter. When the town's school board asks for Hill's credentials, he distracts them by pointing out that they could be a singing quartet, turning suspicion into a playful opportunity to charm the crowd.
Hill reveals to Marcellus that, along with gathering money from the entire town, he plans to woo Marian. He visits the library and flirts with Marian Paroo, who shuts down all of his advances, though she secretly admires him. Hill then visits Mrs. Paroo and she signs Winthrop Paroo up to play cornet in the band, quietly approving the unlikely alliance forming between the two families.
The Wells Fargo Wagon arrives with the instruments, uniforms, and instruction booklets for the band. When Winthrop gets his cornet, Marian sees how happy he is and she destroys the evidence against Hill, choosing to let the moment of joy speak for itself.
On the day of the Fourth of July picnic, anvil salesman Charlie Cowell arrives in River City to tell Mayor Shinn about Hill's lies, but Marian distracts him by kissing him, delaying the confrontation and buying Hill time. Marian realizes that Charlie's claims are most likely lies and agrees to meet Hill at the footbridge later that evening. Marian and Hill head to the bridge and she assures him that she will always love him, even if he leaves her to travel to another town. He leaves her to meet with Marcellus, who has collected the money for the uniforms and they make a plan to leave River City.
Marian admits that she knew he was lying about his education and they depart happily, deeply in love with each other. Mayor Shinn interrupts the picnic to let Charlie speak, then declares that they've been swindled by Hill and that he plans to leave town. The crowd follows Shinn to track down Hill, and Marcellus goes to Hill's hotel room to tell him to leave. Winthrop angrily tells Hill that he hates him, but Marian convinces him that Hill brought happiness to the town. Though the Paroos try to urge him to go, Hill chooses to stay with Marian, and is captured only to be saved by a spontaneous parade: Tommy and Marcellus interrupt the meeting with a group of boys in band uniforms. The parents, moved by their children's pride, forget their anger and cheer the band on. Hill is briefly set free and leads the crowd down the street in a parade, joined by Marian, sealing a complicated but hopeful ending for River City.