Henry Higgins (Rex Harrison), an arrogant, irascible professor of phonetics, boasts to a new acquaintance, Colonel Pickering (Wilfrid Hyde-White), that he can teach any woman to speak so "properly" that he could pass her off as a duchess. The person whom he is shown thus teaching is one Eliza Doolittle (Audrey Hepburn), a young woman with a horrendous Cockney accent who is selling flowers on the street. After overhearing this, Eliza finds her way to the professor's house and offers to pay for speech lessons, so that she can work in a flower shop. Pickering is intrigued and wagers that Higgins cannot back up his claim; Higgins takes Eliza on free of charge as a challenge to his skills.
Eliza's father, Alfred P. Doolittle (Stanley Holloway), a dustman, arrives three days later, ostensibly to protect his daughter's virtue, but in reality simply to extract some money from Higgins, and is bought off with £5. Higgins is impressed by the man's genuineness, natural gift for language and especially his brazen lack of morals (Doolittle explains, "Can't afford 'em!").
Eliza goes through many forms of speech training, such as speaking with marbles in her mouth and trying to recite the sentence "In Hertford, Hereford, Hampshire, hurricanes hardly ever happen" without dropping the 'h', and to say "The rain in Spain stays mainly in the plain" rather than "The rine in spine sties minely in the pline". At first, she makes no progress (due to Higgins's harsh approach to teaching), but just as she, Higgins, and Pickering are exhausted and about to give up, Higgins softens his attitude and gives an eloquent speech about the beauty and history behind the English language. Eliza tries one more time and finally "gets it"; she instantly begins to speak with an impeccable upper class accent.
Higgins takes her on her first public appearance to Ascot Racecourse, where she makes a good impression with her stilted, but genteel manners, only to shock everyone by a sudden and vulgar lapse into Cockney; "C'mon Dover, move your bloomin' arse!". Higgins, who dislikes the pretentiousness of the upper class, partly conceals a grin behind his hand, as if to say "I wish I had said that!"
The bet is won when Eliza successfully poses as a mysterious lady of patently noble rank at an embassy ball, despite the unexpected presence of a Hungarian phonetics expert trained by Higgins. Higgins's callous treatment of Eliza afterwards, especially his indifference to her future prospects, leads her to walk out on him, leaving him mystified by her ingratitude. When she is gone however, he comes to the horrified realization that he has "grown accustomed to her face." Putting aside his resentment about the intrusion on his life and toward women in general, Higgins finds Eliza the next day and attempts to talk her into coming back to him. During a testy exchange, Higgins's ego gets the better of him, and his former student rejects him.
Higgins makes his way home, stubbornly predicting that Eliza will be ruined without him and come crawling back. However, his bravado collapses and he is reduced to playing old phonograph recordings of her voice lessons. To Higgins' great delight, Eliza chooses that moment to return to him.