Bassanio, a young Venetian of noble rank, wishes to woo the beautiful and wealthy heiress Portia of Belmont. Having squandered his estate, Bassanio approaches his friend Antonio, a wealthy merchant of Venice who has previously and repeatedly bailed him out, for 3,000 ducats needed to subsidise his expenditures as a suitor. Antonio agrees, but since he is cash-poor – his ships and merchandise are busy at sea – he promises to cover a bond if Bassanio can find a lender, so Bassanio turns to the Jewish moneylender Shylock and names Antonio as the loan's guarantor.
Antonio has already made an enemy of Shylock through his outspoken antisemitism. The moneylender knows of Antonio's customary refusal to borrow or lend money with interest. Shylock is at first reluctant to grant the loan, citing abuse he has suffered at Antonio's hand, but finally agrees to lend the sum to Antonio without interest upon one condition: if Antonio is unable to repay it at the specified date, Shylock may take a pound of Antonio's flesh. Bassanio does not want Antonio to accept such a risky condition; Antonio is surprised by what he sees as the moneylender's generosity (no "usance" – interest – is asked for), and he signs the contract. With money at hand, Bassanio leaves for Belmont with his friend Gratiano, who has asked to accompany him. Gratiano is a likeable young man, but is often flippant, overly talkative, and tactless. Bassanio warns his companion to exercise self-control, and the two leave for Belmont and Portia.
Meanwhile in Belmont, Portia is awash with suitors. Her father left a will stipulating each of her suitors must choose correctly from one of three caskets – one each of gold, silver and lead. If he picks the right casket, he gets Portia. The first suitor, the luxurious Prince of Morocco, chooses the gold casket, interpreting its slogan "Who chooseth me shall gain what many men desire"(act 2 scene 7) as referring to Portia. The second suitor, the conceited Prince of Arragon, chooses the silver casket, which proclaims "Who chooseth me shall get as much as he deserves"(act 2 scene 7), imagining himself to be full of merit. Both suitors leave empty-handed, having rejected the lead casket because of the baseness of its material and the uninviting nature of its slogan: "Who chooseth me must give and hazard all he hath."(act 2 scene 7) The last suitor is Bassanio, whom Portia wishes to succeed, having met him before. As Bassanio ponders his choice, members of Portia's household sing a song which says that "fancy" (not true love) is "engend'red in the eyes, With gazing fed.", prompting Bassanio to disregard "outward shows" and "ornament" and chooses the lead casket, winning Portia's hand.
At Venice, Antonio's ships are reported lost at sea. This leaves him unable to satisfy the bond. Shylock is even more determined to exact revenge from Christians after his daughter Jessica had fled home and eloped with the Christian Lorenzo, taking a substantial amount of Shylock's wealth with her, as well as a turquoise ring which was a gift to Shylock from his late wife, Leah. Shylock has Antonio brought before court.
At Belmont, Bassanio receives a letter telling him that Antonio has been unable to return the loan taken from Shylock. Portia and Bassanio marry, as do Gratiano and Portia's handmaid Nerissa. Bassanio and Gratiano then leave for Venice, with money from Portia, to save Antonio's life by offering the money to Shylock. Unknown to Bassanio and Gratiano, Portia has sent her servant, Balthazar, to seek the counsel of Portia's cousin, Bellario, a lawyer, at Padua.
The climax of the play comes in the court of the Duke of Venice. Shylock refuses Bassanio's offer of 6,000 ducats, twice the amount of the loan. He demands his pound of flesh from Antonio. The Duke, wishing to save Antonio but unable to nullify a contract, refers the case to a visitor who introduces himself as Balthazar, a young male "doctor of the law", bearing a letter of recommendation to the Duke from the learned lawyer Bellario. The doctor is actually Portia in disguise, and the law clerk who accompanies her is actually Nerissa, also in disguise. As Balthazar, Portia repeatedly asks Shylock to show mercy in a famous speech, advising him that mercy "is twice blest: It blesseth him that gives and him that takes." (IV,i,185) However, Shylock adamantly refuses any compensations and insists on the pound of flesh.
As the court grants Shylock his bond and Antonio prepares for Shylock's knife, Portia deftly appropriates Shylock's argument for 'specific performance', and points out that the contract only allows Shylock to remove the flesh, not the "blood", of Antonio (see quibble). Thus, if Shylock were to shed any drop of Antonio's blood, his "lands and goods" would be forfeited under Venetian laws. Further damning Shylock's case, she tells him that he must cut precisely one pound of flesh, no more, no less; she advises him that "if the scale do turn, But in the estimation of a hair, Thou diest and all thy goods are confiscate."
Defeated, Shylock concedes to accepting Bassanio's offer of money for the defaulted bond, first his offer to pay "the bond thrice", which Portia rebuffs, telling him to take his bond, and then merely the principal, which Portia also prevents him from doing on the ground that he has already refused it "in the open court." She then cites a law under which Shylock, as a Jew and therefore an "alien", having attempted to take the life of a citizen, has forfeited his property, half to the government and half to Antonio, leaving his life at the mercy of the Duke. The Duke immediately pardons Shylock's life. Antonio asks for his share "in use" until Shylock's death, when the principal will be given to Lorenzo and Jessica. At Antonio's request, the Duke grants remission of the state's half of forfeiture, but on the condition of Shylock converting to Christianity and bequeathing his entire estate to Lorenzo and Jessica (IV,i).
Bassanio does not recognise his disguised wife, but offers to give a present to the supposed lawyer. First she declines, but after he insists, Portia requests his ring and Antonio's gloves. Antonio parts with his gloves without a second thought, but Bassanio gives the ring only after much persuasion from Antonio, as earlier in the play he promised his wife never to lose, sell or give it. Nerissa, as the lawyer's clerk, also succeeds in likewise retrieving her ring from Gratiano, who does not see through her disguise.
At Belmont, Portia and Nerissa taunt and pretend to accuse their husbands before revealing they were really the lawyer and his clerk in disguise (V). After all the other characters make amends, Antonio learns from Portia that three of his ships were not stranded and have returned safely after all.