The play opens in the beggar shop owned by Peachum. Peachum has taken control of all the beggars in London and runs a shop that outfits the beggars and provides them with a location to beg in. A young man comes in and asks for a job. Peachum makes the man pay him first and then shows the man the five states of human misery before giving the man a costume to wear.
When Mrs. Peachum arrives he asks her about his daughter Polly. She tells him that Polly has been seeing a gentleman lately. When she describes the man, Peachum realizes that it is none other than Mac the Knife, London's most powerful criminal. He runs upstairs and sees that Polly did not come home that night.
Meanwhile, Polly and Macheath have just broken into a stable where they are getting married. The rest of Mac's gang arrives and they bring in wedding presents. Everything has been stolen, including the stable. Soon the parson arrives and they sit down to eat. Polly provides them with some entertainment by singing a song. After she is done Tiger Brown the Sheriff arrives, but instead of arresting them all he greets Macheath as an old friend. Mac explains that he and Tiger Brown served together in the war and that he has paid Brown kickbacks on every job ever since. After Brown leaves the men present Polly and Macheath a large bed to sleep in and then leave them alone.
Polly returns home to find her parents furious with her for marrying Macheath. She tries to defend the marriage, but they decide to take on Macheath and destroy him. Mr. Peachum tells his wife that he will go to Tiger Brown and make him arrest Macheath. Meanwhile, Mrs. Peachum agrees to go and bribe the whores whom Macheath goes to every week. She is hoping that the whores will turn in Macheath.
Polly goes with her father and watches as Brown agrees to arrest Macheath. She then goes back to the stable where Mac is staying and tries to warn him. He does not believe her until she produces the charges that are being levied against him. Instead of being emotional, Mac focuses on his business. He hands the business over to Polly and tells her what to do. Soon thereafter his gang arrives and Mac informs them that Polly will be their boss while he goes away. Matthew tries to challenge Polly's authority, but she threatens to kill him if he opens his mouth again; the other thieves applaud her and accept her leadership.
Meanwhile, Mrs. Peachum approaches Low-Dive Jenny, a prostitute, and convinces her to turn in Macheath should he be foolish enough to show up at the brothel.
The evening in the brothel one of Mac's men is trying to convince the whores that Macheath would not be so foolish as to show up. However, no sooner does he say this than Mac arrives and sits down. Jenny takes Mac's palm and reads it, warning him that a woman will betray him. He thinks she means Polly. Jenny soon sneaks out while Mac is talking with the whores and gets the police and Mrs. Peachum. Constable Smith enters and tries to arrest Mac, who knocks the man down and jumps out the window. Unfortunately for him, Mrs. Peachum is standing there with the other police officers. They take him away. Jenny wakes up Macheath's man who has fallen asleep while reading and missed the entire scene.
Now in prison, Mac is afraid that Tiger Brown will learn that he has been playing around with Brown's daughter Lucy. She soon arrives and is horrified to see him in jail. To complicate matters further, Polly arrives and also claims Mac as her husband. Both women argue; Lucy indicates that she is pregnant and therefore has a better claim to Mac, but Polly is "legally" married to him and she has papers to prove it. Mac chooses to support Lucy instead of Polly because he is more afraid of Tiger Brown. Mrs. Peachum then arrives and drags Polly away. Lucy, happy to finally be alone with Mac again, hands him his hat and cane and leaves. When Constable Smith returns he tries to get the cane, but Mac is faster than he is and manages to escape. Brown enters the cell and is relieved to see it empty. However, Peachum also arrives and threatens to disrupt the coronation if Brown does not find Macheath and arrest him again immediately.
That night Peachum outfits his beggars with signs and clothes in an effort to ruin the coronation parade the next morning. The whores arrive, led by Jenny, and ask for their reward for turning in Macheath. Peachum refuses to pay them on the grounds that Mac escaped already. Jenny, in a fit of rage, tells them that Mac is a far better man than any of them. She then accidentally reveals that Mac had gone straight to her place and comforted her, and that he is now with another whore named Suky Tawdry. Peachum is elated by this information and promises to give the whores the reward money. He sends one of his beggars to get the police.
Tiger Brown arrives only a few minutes later. Brown has decided that rather than arrest Macheath it would be far easier for him to arrest Peachum and all the beggars, thereby preventing them from ruining the coronation. Peachum merely ignores Brown's threats and points out that there are far more beggars than there are police. He asks Brown point-blank how if would look if several hundred men were clubbed down on the day of the procession. Unable to arrest Peachum, Brown realizes that he is caught in a bind. Peachum then demands that Brown arrest Macheath and gives him the address where Macheath is staying. Peachum lastly send the beggars to the jail rather then that coronation.
Polly goes to visit Lucy in an effort to find out where Mac is. It turns out that neither of them knows his whereabouts, causing Polly to laugh and state that Mac has stood them both up. They soon hear a noise in the hallway and realize that Mac has been rearrested. Mrs. Peachum shows up with widow's clothing and makes Polly change into it.
The next morning, the same day the coronation procession is set for, Macheath is brought out of his cell and locked into a public cell. He is going to be hung at six in the morning, and has only an hour to live. He offers Smith one thousand pounds in cash if Smith will let him escape, but Smith refuses to make any promises. Jake and Matthew arrive and Mac asks them for money; they say that it will be hard to get anything so early in the morning but leave promising to find something. Polly also arrives and tells Mac that his business is going well but that she has no money on her. Brown finally enters the cell as well and he and Macheath settle their accounts (recall that Mac pays Brown kickbacks for helping him). Having failed to get the money, Smith refuses to help Macheath.
Soon thereafter all of the characters return and stand next to the cage. Jake and Matthew apologize for not getting the money in time and tell Mac that all the other crooks are stealing elsewhere. Even the whores have showed up to watch him die. Mac gives a last speech in which he claims all the small crooks are being pushed aside by corporate interests. Peachum then stands up and gives the final speech, arguing that since this is an opera and not real life, they will save Macheath. Brown enters in the form of a mounted messenger and brings a special order from the Queen. She has decided to pardon Macheath and to also elevate him to a hereditary knighthood. Mac rejoices his good luck while Peachum remarks that such a thing would never happen in real life.