||This plot summary may be too long or overly detailed.|
Viola has been shipwrecked in Illyria; she has lost her twin, Sebastian. She disguises herself as a boy and uses the name Cesario for protection. Thus disguised, Viola becomes a page for Orsino, the Duke. Orsino wants to bone Olivia, who is in mourning for the deaths of her father and brother. As Orsino's proxy, Viola is sent to Olivia with love letters. Viola refuses to budge until she is let in to see Olivia; Olivia, intrigued by the impudent young "boy," contrives to get "Cesario" to return by sending her steward, Malvolio, after her with one of Olivia's rings. Viola realizes to her dismay that Olivia has fallen for her Cesario rather than Duke Orsino—but Viola likes Orsino.
In the two major subplots of the play, Sebastian (Viola's twin, presumed dead) comes ashore in Illyria thinking that Viola has drowned in the shipwreck. A man named Antonio rescued him from the surf, and continues to aid him—at some risk to himself, as Antonio fought against the Duke at one time. Meanwhile, in Olivia's house, Sir Toby Belch (her uncle) has hoodwinked a foppish Sir Andrew Aguecheek into supporting him by convincing him that he could be a suitor to Olivia. There is a running feud between Malvolio and Belch; with the help of Maria, Olivia's maid, and Feste, a clown, Belch plots to make a buffoon of the steward. Maria writes a love letter to Malvolio that will make him think Olivia has fallen for him.
Malvolio falls entirely for the sport, which eventually leads to his confinement as a madman. All the while, Belch is egging Sir Andrew into a duel with Viola's "Cesario" character as she departs from Olivia; Olivia is now entirely smitten with Cesario, even though Viola continues to press Orsino's cause. As Viola and Sir Andrew prepare for a duel that neither one wants, Antonio happens upon the scene. Believing Viola to be Sebastian, he intervenes and is arrested. Viola, of course, does not recognize Antonio. Later, Belch and Sir Andrew encounter Sebastian, who does not back down from Aguecheek when challenged and resoundingly beats him. Olivia intervenes in the matter, and—mistaking Sebastian for Viola/Cesario—presses her suit for him. A bemused Sebastian agrees to marry her.
Antonio is brought before the Duke for questioning, and Viola relates the events of the duel. Antonio tells everyone how he dragged "this man" from the surf, saving his life. Then Olivia enters, searching for her new husband—which she thinks is Viola (as Cesario). Adding to this confusion, Belch and Aguecheek enter claiming that Viola/Cesario has violently assaulted them. In the midst of Viola's denials, Sebastian appears. The brother and sister recognize one another and are reunited; Sebastian helps to clear the confusion as to who fought and married who. At the end, Orsino and Viola pledge their love, Olivia and Sebastian will remain satisfactorily wed, and Olivia rebukes Belch and Maria for their abuse of Malvolio, who vows his revenge. Belch agrees to wed Maria to make up for getting her in trouble, and all—except the disgruntled Malvolio—live happily ever after.