The action takes place on the quarter-deck of HMS Pinafore, at anchor off Portsmouth.
Act I Noon
The sailors are working on deck when Little Buttercup, a dockside vendor, comes on board to sell her wares. She hints that, despite her innocent appearance, she may be hiding a dark secret
Able Seaman Ralph Rackstraw, widely regarded as the most proficient sailor in all the fleet, declares his love for the Captain’s daughter, Josephine. His shipmates offer their sympathies, for they know there is little hope of Ralph’s feelings being reciprocated.
The gentlemanly and popular Captain Corcoran greets his crew and compliments them on their politeness; he returns the favour by never himself using bad language. After the sailors leave, the Captain confesses to Buttercup that Josephine is reluctant to consider marriage to Sir Joseph Porter, the First Lord of the Admiralty. Buttercup says that she knows what it is like to love in vain. As she leaves, the Captain remarks on her attractive demeanour. Josephine enters and tells her father that she is in love with a humble member of his crew. However, she assures him that, as a dutiful daughter, she will never reveal her feelings to this sailor.
Sir Joseph is piped on board, accompanied by his considerable retinue of admiring female relatives. He recounts his meteoric rise from humble beginnings to his present exalted position, achieved entirely through persistence – and despite his lack of nautical qualifications. He then delivers a lesson in etiquette to the Captain, instructing him always to say ‘if you please’ after giving an order, as a British sailor is any man’s equal – excepting Sir Joseph’s. Sir Joseph has even composed a song to illustrate the point, and he presents a copy to Ralph. Bolstered by Sir Joseph’s views on equality, Ralph decides to declare his love to Josephine. This delights his shipmates with the exception of Dick Deadeye, who maintains that equality’s out of the question when people have to obey others’ orders.
Shocked by his views, the sailors force Dick to listen to Sir Joseph’s song before they withdraw, leaving Ralph alone on deck. When Josephine appears, Ralph confesses his love in terms surprisingly eloquent for a common sailor. She is moved; while she has found Sir Joseph’s attentions nauseating, she knows that it is her duty to marry him. Disguising her true feelings, she rejects Ralph.
Ralph summons his shipmates and tells them that he is bent on suicide. He puts a pistol to his head, but as he is about to pull the trigger, Josephine returns and confesses that she loves him after all. The couple plan to elope that night. Dick Deadeye warns them to reconsider, but everyone ignores him.
Interval of 20 minutes
Act II Night
The Captain expresses his many concerns and Buttercup offers him her sympathy. He tells her that, but for the difference in their social standing, he would return her affection. She warns him that things are not all they seem, and a change is in store for him. He fails to understand her cryptic warning.
Sir Joseph complains to the Captain that Josephine has not yet agreed to marry him. The Captain suggests that she is probably dazzled by his exalted rank and that if Sir Joseph can convince her that love is a leveller of social status she will accept his proposal. They withdraw, and Josephine enters, feeling guilty about her planned elopement with Ralph and concerned about giving up a life of comfort. When Sir Joseph makes his argument, a delighted Josephine declares that she will hesitate no longer. The Captain and Sir Joseph rejoice, but Josephine is now more determined than ever to marry Ralph.
Dick tells the Captain of the lovers’ planned elopement. The Captain confronts the couple as they try to leave the ship. The pair declare their love, justifying their actions because Ralph ‘is an Englishman!’ The furious Captain is unmoved and, in an outburst, swears at them. Sir Joseph and his relatives overheard the Captain and are shocked by his bad language. The Captain is ordered to his cabin.
When Sir Joseph enquires what provoked the usually polite Captain’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 incarcerated in the brig. Buttercup now comes forward to reveal her long-held secret: many years ago, when she practised baby-farming, she had cared for two babies, one of low birth, the other of noble origins. Unfortunately, she mixed up the children – the well-born baby was Ralph, and the low-born Captain Corcoran.
Sir Joseph now realises that Ralph should have been the Captain, and the Captain an ordinary seaman. He summons both: Ralph appears now as the Captain, in command of the Pinafore, and Corcoran as a common sailor. Sir Joseph’s marriage to Josephine is now impossible – love may well be a great leveller of social rank but, as far as Sir Joseph is concerned, not as much as that. He hands Josephine to Captain Rackstraw. The former Captain’s now humble rank leaves him free to marry Buttercup. Sir Joseph settles for his cousin Hebe, and all ends in general rejoicing.