Professor Higgins, a distinguished philologist and phonetician, meets the flower seller Eliza Doolittle in the flower market near Covent Garden in London after a visit to the opera. He takes her powerfully vulgar speech, which in the English version has a strong Cockney accent and in the German version is often embellished with Berlin or Viennese, as an example of the deformation of the mother tongue (Can't anyone teach the children?/Why Can't the English?). Higgins believes that people are defined not by their origins but by their language; even a flower girl like Eliza, Higgins argues, could improve her standing and be a respected lady, even run a respectable flower shop, provided she spoke proper English.
Eliza is enchanted by this idea, the wishes she expresses are modest: "A little room with a sofa in it, gas lighting, chocolates and never again cold legs" - (Wäre det nicht wundascheen?/Wouldn't It be Loverly?). She has to struggle to make a living every day and also support her father, Alfred P. Doolittle, who regularly ekes out a living at her expense. In a way, Doolittle has managed to live life his way, which he celebrates with two drinking buddies (Mit 'nem Kleenen Stückchen Glück/With a Little Bit of Luck). He rejects any responsibility and morals and lives into the day. Thus "socially" prejudiced and without schooling, it seems as if Eliza has no chance of ever rising above the status of a poor flower girl.
Eliza takes Higgins' talk at face value and shows up at the professor's house to take language lessons. The matter is hardly worth discussing with Higgins, when his friend Colonel Pickering proposes a wager: If Higgins succeeds in making a lady of Eliza within six months, he will pay the cost of her education. Eliza's "final examination" is to be the Diplomatic Ball at Buckingham Palace. Higgins accepts the wager, Eliza is assigned a room in his house, and a hard apprenticeship begins with the confirmed bachelor. Eliza must practice speaking from dawn to dusk, and is treated gruffly and condescendingly by Higgins, so that the lessons are more like dressage. Eliza is furious about this and dreams of revenge (Just You Wait).
Eliza finally achieves a phonetic breakthrough: she speaks "g" instead of "j", "ei" instead of "e" and not "i" but "ü" (Es grünt so grün/The Rain in Spain). This is celebrated euphorically, and the completely excited Eliza finds no sleep at night (Ich hätt' tanzt heute' Nacht/I Could Have Danced All Night). Now Eliza must pass the test run in high society. Professor Higgins and Colonel Pickering choose the horse race at Ascot. Eliza is given strict guidelines for conversation; she is allowed to talk about the weather and health. But even these seemingly innocuous topics have their pitfalls; Eliza reports to the fine company in her best English that her aunt has been "bumped off." A little later, she shocks the audience by cheering her horse in a race with the exclamation, "Run faster, or I'll pepper your ass! ".
Her unconventional appearance at Ascot brings her a suitor from better circles: Freddy Eynsford-Hill is very taken with the pretty and refreshing Eliza. He begins to patrol her street, hoping that Eliza will leave the house one day (In the Street, My Darling, Where You Live/On the Street Where You Live). He also writes her love letters and sends flowers. The beloved, however, does not notice much of this. She can speak now, but her education still leaves much to be desired. As the big evening approaches, Eliza is able to shine at the Diplomatic Ball at Buckingham Palace. She enchants with her extraordinary and graceful nature. People wonder who the beautiful stranger is. The Hungarian phonetician Prof. Zoltán Kárpáthy, a former student of Higgins, tries to shed light on the mystery. To Higgins' and Pickering's edification, his diagnosis is that such clean English is only spoken abroad; in his opinion, Eliza is a Hungarian princess!
That same evening, Higgins and Pickering congratulate each other on a job well done. They pat each other on the back (It's You Who Did It/You Did It) and celebrate their triumph. Eliza feels left out; she was trained, worked, but the credit goes solely to the professor for whom she won the bet. She makes Higgins understand how much she feels disrespected and humiliated. When asked what is to become of her now, Higgins accuses her of ingratitude. He thinks she is a foolish child, and is all the more surprised when Eliza disappears the next day.
Together with Freddy Eynsford-Hill, who keeps watch outside Higgins' house (Do It! / Show Me), she visits the area of London where she was at home six months ago. But she is no longer recognized there. She is now too refined to be a flower lady, but she lacks the money to be a fine lady. Eliza decides to teach phonetics herself and marry Freddy.
When she confronts Prof. Higgins with this decision, he is forced to realize that he misses Eliza (I've Grown Accustomed to Her Face/I've Grown Accustomed to Her Face), which Eliza overhears because she happens to be at the Professor's house for some things she still wants to get. My Fair Lady ends on a conciliatory note, but remains open-ended: While for Shaw's original there is a later formulated resolution by the poet (Eliza actually marries Freddy), Lerner commented on this, "I don't know if Shaw is right."