The narrative opens with Duke Orsino of Illyria pining for the grieving Countess Olivia, who has sworn off the company of men for seven years to mourn her deceased brother. Meanwhile, a violent shipwreck on the Illyrian coast separates the twins Viola and Sebastian. Believing her brother drowned, Viola disguises herself as a young male page named Cesario and enters the service of Duke Orsino.
Orsino quickly grows fond of his new page and dispatches Cesario to woo Olivia on his behalf. The plan backfires when Olivia falls instantly and passionately in love with the disguised Viola instead of the Duke. This creates a tangled romantic triangle, as Viola has meanwhile developed secret romantic feelings for Orsino.
Parallel to the main romance, Olivia’s household descends into chaotic merrymaking led by her hard-drinking uncle Sir Toby Belch and the foolish suitor Sir Andrew Aguecheek. They are frequently joined by the witty court jester, who trades barbs and philosophical nonsense with the inhabitants of the estate, highlighting the general folly surrounding them.
Annoyed by the pompous self-righteousness of Olivia’s steward, Malvolio, the household plot an elaborate revenge against him. Maria, Olivia’s clever gentlewoman, forges a love letter in the Countess’s handwriting, tricking Malvolio into believing Olivia is secretly in love with him and wishes him to adopt eccentric behaviors.
Malvolio falls entirely for the trap, appearing before Olivia in yellow stockings and cross-gartered hosiery while flashing inappropriate smiles. Dismayed by what she perceives as sudden madness, Olivia has him confined and cared for, while the plotters continue to torment the captive steward through the clever impersonation of a local curate.
Complications multiply with the arrival of Sebastian, Viola’s surviving twin brother, who is accompanied by the sea captain Antonio. Sebastian’s striking resemblance to Viola causes immediate confusion among the residents of Illyria, leading mistaken identities to reach a comical peak during random street altercations.
The tangled webs unravel completely when Sebastian and Viola are finally brought together in the presence of both Olivia and the Duke. The siblings are joyfully reunited, the romantic pairings are resolved to mutual satisfaction, and Malvolio is released from his torment with a vow to seek revenge on the entire household.