One rainy night in Covent Garden, London, a crowd of people from various social classes all seek shelter under the same church portico. A wealthy mother (later revealed to be Mrs. Eynsford Hill) waits exasperatedly with her daughter Clara for her son Freddy to find a taxi. Freddy enters, unable to find one, but his mother sends him back out into the rain to look again. Under the portico, a poor flower-girl (Eliza Doolittle) sells a flower to a gentleman (Colonel Pickering). A bystander tells Eliza to watch out for a strange man in the back of the crowd taking notes. Eliza thinks that the man is a policeman and that she is in trouble. The man, who turns out to be Henry Higgins, steps forward and guesses where everyone is from based on their manner of speech. Everyone is confused and annoyed by the meddlesome Higgins. Eliza thinks he is a policeman trying to get her in trouble and insists that she is "a good girl." Pickering asks Higgins how he can tell where everyone is from, and Higgins explains that he studies phonetics and teaches people how to speak in different accents. He says that he could teach the flower-girl Eliza to speak so well in just three months that she could pass for a noble lady. Higgins and Pickering introduce themselves to each other, realizing that they are familiar with each other's work (Pickering is also a linguist). The rain stops and the crowd under the portico disperses. Higgins and Pickering leave to get dinner together, while Clara and her mother walk to a bus. Freddy finally returns with a cab, only to find that his family is no longer there.
The next morning, in Higgins' "laboratory" at his home, Higgins is showing all of his scientific instruments and tools for recording and studying speech to Pickering. Eliza arrives and offers to pay Higgins for speaking lessons, so that she can learn to "talk more genteel," and get a better job. Higgins doesn't think she can afford to pay him, and scoffs rudely at her. Pickering steps in and bets Higgins that he can't teach Eliza to speak so well that she passes as a wealthy lady at an ambassador's garden party in six months. He offers to pay for her lessons. Higgins likes the idea and tells his housekeeper Mrs. Pearce to wash Eliza and dress her in new clothes, though Eliza protests. Eliza refuses to participate in the bet, and Mrs. Pearce tells Higgins not to "walk over" Eliza. Higgins neglects Eliza's feelings, ordering her to live with him for six months and take speaking lessons. Mrs. Pearce takes Eliza away to talk to her in private. Meanwhile, Eliza's father, Alfred Doolittle, comes to Higgins' house. He says that he hasn't seen his daughter in months, but learned of her whereabouts from the taxi driver who brought her to the house. He asks Higgins for five pounds in return for letting Eliza stay with him. Higgins and Pickering are scandalized by Mr. Doolittle's willingness to "sell" his daughter, but Higgins eventually agrees to give him money. As Mr. Doolittle leaves, he runs into Eliza, who has washed and changed into new clothes. Mr. Doolittle calls her "miss" before recognizing her, getting into a fight with her, and leaving. Mrs. Pearce enters and tells Eliza that she has more clothes for her to try on. Eliza leaves eagerly, having seemingly accepted the offer to stay with Higgins.
It is a few months later, at the home of Henry Higgins' mother, Mrs. Higgins. Mrs. Higgins is ready to have some friends over and is annoyed when Higgins barges in. Higgins tells her about Eliza and says that he wants Eliza to sit with Mrs. Higgins and her friends and try to act like a lady. Before Higgins leaves, some of Mrs. Higgins' friends arrive: the Eynsford Hills. Higgins at first doesn't recognize them from the portico in Covent Garden. Eliza arrives, and the Eynsford Hills don't recognize her as the flower-girl. Everyone starts to make small talk about the weather, but Eliza makes the mistake of talking about the death of her aunt (in which she suspects foul play) and her father's drinking habit. Freddy seems amused by Eliza, though Mrs. Eynsford Hill is shocked by her conversation. After Eliza leaves, Clara tells her mother that Eliza's speech is a new, fashionable form of small talk. Clara says that manners are only a matter of habit, so there are no right or wrong ones. As the Eynsford Hills leave, Freddy says that he would like to meet Eliza again sometime. Higgins asks his mother whether Eliza was presentable, and she says that Eliza was not. She tells Higgins there is no hope for Eliza to pass as a lady. Mrs. Higgins then cautions her son about treating Eliza like a "live doll," but Pickering assures her that they take Eliza seriously. Higgins refers to Eliza as merely an experiment. Mrs. Higgins worries about what will happen to Eliza when the "experiment" is over.
Several months later, Eliza, Higgins, and Pickering return to Higgins' house at midnight, after a long day and night. They have gone to a garden party, followed by a dinner party, followed by the opera. Eliza successfully passed as a wealthy lady, and Higgins has won his bet. Higgins says he was not surprised by Eliza's success and has in fact long been bored with the wager. He thanks God that the experiment is over. Eliza is offended at how the two men are speaking of her and throws Higgins' slippers at him, calling him selfish and inconsiderate. Higgins thinks she is ungrateful. Eliza regains her composure and worries about what will happen to her now. Higgins suggests she marry someone wealthy, to ensure a comfortable life, but Eliza thinks of this as a kind of prostitution and rejects the idea. Higgins says Pickering can get her a job in a nice florist's shop. Eliza asks whether her clothes belong to her now, because she doesn't want to be accused of stealing them. Higgins is offended by the question and tells Eliza she has wounded him "to the heart."
The next day, Mrs. Higgins is sitting in her drawing room, when her parlor-maid tells her that Higgins and Pickering are downstairs calling the police. Mrs. Higgins tells the maid to go upstairs and inform Eliza, but not to have her come down. Higgins comes into the room and tells his mother that Eliza has run away. Mrs. Higgins tells him that Eliza has the right to leave his house whenever she wishes. Pickering enters and says that he has spoken with the police about Eliza. The maid announces that a gentleman named Mr. Doolittle is at the door. Higgins doesn't think that this can be Eliza's father, but it turns out to be him, dressed as a gentleman. Mr. Doolittle is upset because Higgins has mentioned his name to a wealthy American named Ezra Wannafeller, who has founded Moral Reform Societies across the world. Higgins joked to Wannafeller that Mr. Doolittle was England's "most original moralist," and Wannafeller left Doolittle money in his will. Mr. Doolittle is angry at having been turned into a somewhat wealthy gentleman. He says his new money has brought him nothing but worries and problems and tells Higgins that now he needs to be taught how to speak proper English. Mrs. Higgins tells Mr. Doolittle that he can care for Eliza now, but Higgins wants to keep Eliza at his house. Mrs. Higgins scolds Higgins and Pickering for how they have treated Eliza and reveals that Eliza is actually upstairs. Mrs. Higgins calls Eliza down. She is very polite to Pickering and Higgins. Pickering is nice to Eliza, but Higgins is angry and rude to her, ordering her to come back to his house. Eliza thanks Pickering for teaching her good manners by example, and tells him that her transformation was really spurred on by when he called her Miss Doolittle once. Eliza says that she has completely forgotten her old ways of speaking and behaving. Higgins, though, thinks that she will return to her lower-class habits within weeks. Eliza finally sees her father and is shocked to hear that he is going to marry her stepmother. He asks Eliza to come to his wedding. Mrs. Higgins, Eliza, and Pickering all prepare to go to the wedding. Higgins and Eliza are left alone in the room. Eliza says that Higgins only wants her back to do chores and errands for him. Higgins says that he cannot change his rude manners toward her, because he cannot change his nature. He explains that he is rude to everyone, not just her, just as Pickering is polite to everyone. He claims that it is not important to have good or bad manners, but simply to behave the same way toward everyone, regardless of class. Eliza is still reluctant to go back to Higgins' house. She says that she is a slave, despite her expensive clothes. Higgins offers to adopt Eliza or marry her to Pickering, but Eliza wants to marry Freddy Eynsford Hill, which irritates Higgins (he wants her to marry someone of a higher class). Eliza is still angry with Higgins and tells him that all she wants is some kindness from him. She then says that if she can't have kindness from him, she will have her independence. She tells Higgins that she will become a teacher of phonetics, stealing everything she has learned from him in order to take his clients. Higgins is suddenly impressed by Eliza's strength and confidence. Mrs. Higgins comes in to take Eliza to the wedding. As she leaves, Higgins tells Eliza to buy him some things, but Eliza tells him to do it himself. The play ends with Higgins alone in the room, confident that Eliza will do the errand as he asked.