Viola and Sebastian, brother and sister twins who closely resemble each other, are separated when the ship on which they are passengers is wrecked during a great storm at sea. Each thinks that the other is dead and sets out alone with no hope of being reunited.
The lovely and charming Viola is cast upon the shores of Illyria, where she is befriended by a kind sea captain. They decide to dress Viola in men’s clothing and have her take service as a page in the household of young Duke Orsino. Dressed in man’s garb, Viola calls herself Cesario and becomes the duke’s personal attendant. Impressed by the youth’s good looks and pert but courtly speech, Orsino sends “him” as his envoy of love to woo the Countess Olivia, who is mourning the death of her young brother.
The wealthy Olivia lives in a splendid palace with her maid, Maria; her drunken old uncle, Sir Toby Belch; and her steward, Malvolio. Maria and Sir Toby are a happy-go-lucky pair who drink and carouse with Sir Andrew Aguecheek, an ancient nobleman who is much enamored of Olivia. In return for grog supplied by Sir Andrew, Sir Toby is supposed to press Sir Andrew’s suit with Olivia. Actually, however, Sir Toby never stays sober long enough to keep his part of the bargain. All these affairs are observed disapprovingly by Malvolio, Olivia’s ambitious, narrow-minded steward, who cannot tolerate jollity in those about him.
When Cesario arrives at the palace, Olivia is instantly attracted to the page—thinking her a man. She pays close attention to Orsino’s message, but it is not love for Orsino that causes her to listen so carefully. When Cesario leaves, she sends Malvolio after her with a ring. It is a shock for Viola, who hitherto enjoys playing the part of Cesario, to realize that Olivia fell in love with her in her male clothes.
Meanwhile, Maria, Sir Toby, and Sir Andrew decide to stop Malvolio’s constant prying into their affairs and devise a scheme whereby Malvolio will find a note, supposedly written by Olivia, in which she confesses her secret love for him and asks him to wear garish yellow stockings tied with cross garters and to smile continually in her presence. Overjoyed to receive this note, Malvolio soon appears in his strange dress, capering and bowing before the startled countess. Olivia decides that Malvolio lost his wits; to the amusement of the three conspirators, she has him confined to a dark room.
As the days pass, Viola falls in love with the duke, but the latter has eyes only for Olivia, with whom he presses his page to renew his suit. When Cesario delivers another message from Orsino to Olivia, the countess openly declares her love for the young page. Cesario insists, however, that his heart can never belong to any woman. So obvious are Olivia’s feelings for Cesario that Sir Andrew becomes jealous. Sir Toby and Maria insist that Sir Andrew’s only course is to fight a duel with the page. Sir Toby delivers Sir Andrew’s blustering challenge, which Cesario reluctantly accepts.
While these events unfold, Viola’s twin brother, Sebastian, is being rescued by another sea captain, named Antonio, and the two become close friends. When Sebastian decides to visit the court of Duke Orsino at Illyria, Antonio decides to accompany him, even though he fears that he might be arrested there because he once dueled with the duke. Upon arriving in Illyria, Antonio gives Sebastian his purse for safekeeping, and the two men separate for several hours.
While wandering about the city, Antonio chances upon the duel between Cesario and Sir Andrew. Mistaking the disguised page for her brother, Antonio immediately goes to the rescue of his supposed friend. When officers arrive on the scene, one of them recognizes Antonio and arrests him in the name of the duke. Thinking that Viola is Sebastian, Antonio asks her to return his purse and is surprised and hurt when she disclaims all knowledge of the captain’s money. As Antonio is dragged away, he shouts invectives at “Sebastian” for not returning his purse, thereby alerting Viola to the fact that her brother is still alive.
Meanwhile, the real Sebastian is being followed by Sir Andrew, who never dreamed that this young man is not the same Cesario with whom he just dueled. Prodded by Sir Toby and Maria, Sir Andrew engages Sebastian in a new duel and is promptly wounded, along with Sir Toby. Olivia then interferes and has Sebastian taken to her home, thinking that he is Cesario. After sending for a priest, she marries the surprised—but not unwilling—Sebastian.
As the officers escort Antonio past Olivia’s house, Orsino—accompanied by Cesario—appears at her gates. Orsino recognizes Antonio instantly and demands to know why the sailor returned to Illyria—a city filled with his enemies. Antonio explains that he rescued and befriended the duke’s present companion, Sebastian, and because of his deep friendship for the lad accompanied him to Illyria despite the danger his visit involves. Pointing to Cesario, he sorrowfully accuses the person he supposes to be Sebastian of violating their friendship by not returning his purse.
The duke is protesting against Antonio’s accusation when Olivia appears and salutes Cesario as her husband. Now the duke also begins to think his page ungrateful, especially since he told Cesario to press his own suit with Olivia. Just then Sir Andrew and Sir Toby arrive, looking for a doctor because Sebastian wounded them. Seeing Cesario, Sir Andrew begins to rail at him for his violence until Olivia dismisses the two old men. The real Sebastian then appears and apologizes for having wounded the old men.
Spying Antonio, Sebastian joyfully greets his friend. Antonio and the rest of the amazed group, unable to believe what they see, stare from Cesario to Sebastian. After Viola reveals her true identity and explains how she and her brother became separated, she and Sebastian greet each other warmly. Seeing that the page of whom he grew so fond is a woman, Duke Orsino declares that he will marry her.
After Malvolio is summoned, the plot against him is revealed. As he storms off, vowing revenge, the others begin celebrating the impending marriages of Viola and Orsino and of Sir Toby and Maria. Only Malvolio, unhappy in the happiness of others, remains peevish and disgruntled.