An “introductory” scene opens The Beggar’s Opera, featuring the Beggar and the Player. They directly address the audience about the impending story’s origins, intentions and form. Of primary importance is that the piece be understood as opera, even though it contains no recitative and no epilogue or prologue. The Beggar — the “author” of the piece — assures the audience that his play follows all other conventions of the day's fashionable operas.
The story begins in Peachum’s house, as Peachum flips through his account book. Peachum is a professional “impeacher”; he runs a gang of thieves, highwaymen and prostitutes, profiting by their earnings. When they are no longer of use, he betrays his associates to the criminal court system for a tidy reward. In other words, he impeaches them.
Peachum inquires of his wife, Mrs. Peachum, whether she has lately seen Captain Macheath, one of their more distinguished highwaymen. She has. More importantly, she believes their daughter Polly may be embroiled in a love affair with the Captain. Peachum revolts against this news. It is imperative that they intercede to stop the romance in its tracks. Above all, Polly must not marry Macheath, or else her money and potential earnings will default to Macheath.
Mrs. Peachum asks one of the lesser henchmen, Filch, for information about the romance. Filch is torn between guarding Polly’s confidence and his loyalty to Mrs. Peachum. Mrs. Peachum retires with Filch to ply him with alcohol.
Peachum has meanwhile found Polly, who enters the scene assuring her father that she is merely trifling with Macheath for goods and gifts. This is revealed to be a lie, however, as Mrs. Peachum storms in to announce that Macheath and Polly have indeed married (information she has gotten from Filch). Both parents are outraged.
Polly confesses that she married Macheath because her sexual ardor was so aroused that she needed to safeguard her reputation.
Peachum suspects Macheath has married Polly in an attempt to gain control of her family’s money. Regardless, he realizes a potential benefit to this union. If Polly can secure a jointure — a guarantee of property conferred to a widow upon her husband’s death — he might gather evidence against and then betray Macheath to the authorities. Then the Peachum family will receive both reward money and Macheath's property, while Macheath will end up hanged. Polly protests this plan vehemently. She married Macheath for love, not money.
Polly resolves to warn Macheath of her parents’ cruel intent, so she releases him from her bedchamber, where he has been hiding. As he enters, he swears oaths of fidelity to Polly. Polly enjoins him to flee, insisting they shall reunite when the path is safer.
At a tavern near Newgate prison, the thieves of Peachum’s gang drink, smoke and wax poetic about their depth of friendship towards one another. Matt of the Mint gives a short, rousing speech justifying their trade as a means towards the redistribution of wealth.
Macheath enters the tavern, and asks the men to convince Peachum that he has fled town and quit the gang. The rest of the men exit for 'work,' leaving Macheath alone in the tavern. He is not alone for long before he is visited by several female consorts, the female counterparts to the gang. Although the women strive to imitate the airs of the gentry, they are actually raunchy and lewd. Macheath jostles with them flirtatiously, and two of them, Jenny Diver and Suky Tawdry, wrangle him into a compromising physical position. They draw pistols on the unsuspecting man, and signal to an awaiting Peachum, who enters with the constable. Macheath is subdued and then led away to Newgate Prison.
At Newgate, the jailer Lockit displays his fine assortment of fetters from which, for the right price, Macheath may select the most comfortable pair. Lockit is also Peachum’s most important business partner. They are conspiring to share the reward gained from Macheath's death.
Macheath, alone in his cell, laments his entanglement with Polly. Enter Lucy, daughter of Lockit and jilted lover of Macheath. Lucy is in a rage because Macheath had promised to marry her, but married Polly instead. Macheath lies and assures her that he has not married Polly, and Lucy softens.
Peachum and Lockit, in a different part of the prison, come to blows when Peachum accuses Lockit of stealing money. They soon resolve the matter, reasoning that they need each other. Lucy enters and pleads with her father for Macheath’s release, but Lockit refuses. Lucy returns to Macheath to deliver the bad news.
Enter Polly, who has come to visit her beloved, incarcerated husband. In an effort to keep Lucy’s good faith — after all, she has more power to secure his release than does Polly — Macheath ignores Polly altogether. The women’s enmity towards one another grows hot. Eventually, Peachum bursts in and tears Polly away from Macheath.
Lucy conceives of a way to spring Macheath: her father has a habit of drinking with the inmates and then passing out for several hours. She shall steal the keys from him while he’s out cold.
Lucy’s plan has worked (in between Acts), and Macheath has fled the prison. Lockit immediately realizes his daughter’s part in this escape. If she has collected a fee from Macheath for her services, then there is no harm done, so long as Lockit may collect half. But Lucy has acted only in the service of love. Lockit, enraged, banishes Lucy from his sight. Left alone, Lockit realizes that Peachum will reap the total profit of Macheath’s capture, since Macheath is sure to return to Polly.
Meanwhile, Macheath has fled to the gambling-house, where he reunites with members of his gang. Macheath distributes money owed his friends. The men then discuss their operating plans for the evening’s thievery.
Lockit has tracked Peachum to the man’s stolen-goods warehouse. There, the two discuss their profits from the day until a Mrs. Diana Trapes arrives. She is a manager of stolen goods, and a madam of working women. She despairs that one of their mutual employees, Mrs. Coaxer, is behind on a debt. Mrs. Trapes has forced Mrs. Coaxer to 'work' for the night with a gentleman until the debt is repaid. She refers to this gentleman as “Captain.” Peachum immediately discerns that this captain is Macheath, and offers to pay off Coaxer’s debt in exchange for access to the Captain.
Back at Newgate, Lucy has summoned Polly on the pretense of reconciling with her. Lucy’s real goal, however, is to poison Polly. Polly suspects something untoward in Lucy’s enticement, and refuses to drink. The two women are interrupted as the chain-bound Macheath is dragged back into the prison hold, having been captured at the home of Mrs. Trapes.
The women rush at Macheath, begging for a sign of affection, each one hoping and believing she is (or will be) his one, true wife. Peachum asks Macheath to resolve the matter, so they may avoid a lawsuit between the women after Macheath’s hanging. Macheath refuses to make a choice. The women once again beg for leniency from their fathers, but the men dismiss their pleas.
Soon after, in the condemned-man’s hold, Macheath drinks heavily and steels himself for his imminent hanging. His friends Ben Budge and Matt of the Mint enter to say a fond farewell. Once they are gone, Lucy and Polly rush in, weeping and swearing their love.
A jailer enters to announce the arrival of four more women, each with a child and each calling herself Macheath’s wife. This is enough to make Macheath call for the hangman; he is led away.
The Player and the Beggar re-enter in the play’s penultimate scene. The Player disputes the Beggar’s intended ending, suggesting Macheath's death would make the opera a tragedy, rather than a popular comedy. The Beggar concedes that the fashionable operas of the day always end happily, and agrees to conform to that model. He then directs the rabble to “cry reprieve” for Macheath.
In the final scene, Macheath has been pardoned from hanging. Accompanied by the rabble and the women, he enters in high spirits. Macheath publicly takes Polly as his one, true wife, and the play ends with a high-spirited, carefree song and dance.