The British warship H.M.S. Pinafore is at anchor off Portsmouth. The sailors are on the quarterdeck, proudly "cleaning brasswork, splicing rope, etc."
Little Buttercup, a Portsmouth "bumboat woman" (dockside vendor) – who is the "rosiest, roundest, and reddest beauty in all Spithead" – comes on board to sell her wares to the crew. She hints that she may be hiding a dark secret under her "gay and frivolous exterior". Ralph Rackstraw, "the smartest lad in all the fleet", enters, declaring his love for the Captain's daughter, Josephine. His fellow sailors (excepting Dick Deadeye, the grim and ugly realist of the crew) offer their sympathies, but they can give Ralph little hope that his love will ever be returned.
The gentlemanly and popular Captain greets his "gallant crew" and compliments them on their politeness, saying that he returns the favour by never ("well, hardly ever") using bad language, such as "a big, big D". After the sailors leave, the Captain confesses to Little Buttercup that Josephine is reluctant to consider a marriage proposal from Sir Joseph Porter, the First Lord of the Admiralty. Buttercup says that she knows how it feels to love in vain. As she leaves, the Captain remarks that she is "a plump and pleasing person". Josephine enters and reveals to her father that she loves a humble sailor in his crew, but she assures him that she is a dutiful daughter and will never reveal her love to this sailor.
Sir Joseph comes on board, accompanied by his "admiring crowd of sisters, cousins and aunts". He recounts how he rose from humble beginnings to be "ruler of the Queen's Navee" through persistence, although he has no naval qualifications. He then delivers a humiliating lesson in etiquette, telling the Captain that he must always say "if you please" after giving an order; for "A British sailor is any man's equal" – excepting Sir Joseph's. Sir Joseph has composed a song to illustrate that point, and he gives a copy of it to Ralph. Shortly afterwards, elated by Sir Joseph's views on equality, Ralph decides that he will declare his love to Josephine. This delights his shipmates, except Dick Deadeye, who contends that "when people have to obey other people's orders, equality's out of the question". Shocked by his words, the other sailors force Dick to listen to Sir Joseph's song before they exit, leaving Ralph alone on deck. Josephine now enters, and Ralph confesses his love in terms surprisingly eloquent for a "common sailor". Josephine is touched, but although she has found Sir Joseph's attentions nauseating, she knows that it is her duty to marry Sir Joseph instead of Ralph. Disguising her true feelings, she "haughtily rejects" Ralph's "proffered love".
Ralph summons his shipmates (Sir Joseph's female relatives also arrive) and tells them that he is bent on suicide. The crew expresses sympathy, except for Dick, who provides a stark counterpoint of dissent. Ralph puts a pistol to his head, but as he is about to pull the trigger, Josephine enters, admitting that she loves him after all. Ralph and Josephine plan to sneak ashore to elope that night. Dick Deadeye warns them to "forbear, nor carry out the scheme", but the joyous ship's company ignores him.
Later that night, under a full moon, Captain Corcoran reviews his concerns: his "kindly
crew rebels", his "daughter to a tar is partial", his friends seem to desert him,
and Sir Joseph has threatened a court-
Sir Joseph enters and complains that Josephine has not yet agreed to marry him. The Captain speculates that she is probably dazzled by his "exalted rank" and that if Sir Joseph can persuade her that "love levels all ranks", she will accept his proposal. They withdraw, and Josephine enters, still feeling guilty about her planned elopement with Ralph and fearful of giving up a life of luxury. When Sir Joseph makes the argument that "love levels all ranks", a delighted Josephine says that she "will hesitate no longer". The Captain and Sir Joseph rejoice, but Josephine is now more determined than ever to marry Ralph.
Dick Deadeye intercepts the Captain and tells him of the lovers' plans to elope. The Captain confronts Ralph and Josephine as they try to leave the ship. The pair declare their love, justifying their actions because "He is an Englishman!" The furious Captain is unmoved and blurts out, "Why, damme, it's too bad!" Sir Joseph and his relatives, who have overheard this oath, are shocked to hear swearing on board a ship, and Sir Joseph orders the Captain confined to his cabin.
When Sir Joseph asks what had provoked the usually polite officer's outburst, Ralph
replies that it was his declaration of love for Josephine. Furious in his turn at
this revelation, and ignoring Josephine's plea to spare Ralph, Sir Joseph has the
sailor "loaded with chains" and taken to the ship's dungeon. Little Buttercup now
comes forward to reveal her long-
Sir Joseph now realises that Ralph should have been the Captain, and the Captain
should have been Ralph. He summons both, and they emerge wearing one another's uniforms:
Ralph as Captain, in command of the Pinafore, and Corcoran as a common sailor. Sir
Joseph's marriage with Josephine is now "out of the question" in his eyes: "love
levels all ranks ... to a considerable extent, but it does not level them as much
as that." He hands her to Captain Rackstraw. The former Captain's now-