Jafar, Grang Fizier to the Sultan of Agrabah, is attempting to retrieve a magical oil lamp containing a genie from the Cave of Wonders. After seeing a petty thief’s failed attempt to enter the cave, Jafar and his parrot, Iago, learn that only a “Diamond in the Rough” can enter the cave.
Jasmine, the Sultan’s daughter, frustrated with her life in the palace, flees to Agrabah’s marketplace. There she meets street rat Aladdin and his monkey, Abu. The two discover they have a lot in common. When Aladdin is detained for thievery, Jasmine orders him released, but Jafar lies to her that Aladdin has been executed.
Disguised as an elder, Jafar releases Aladdin and Abu from prison and leads them to the Cave of Wonders. The tiger-shaped head of the cave says to touch nothing but the lamp. Aladdin and Abu enter the cave, where a magic carpet guides them to the lamp. Abu’s attempt to steal a ruby backfires and causes the cave to collapse, but the carpet flies them to the entrance. As Aladdin delivers the lamp, Jafar tries to kill him, but Abu bites Jafar in the arm and gets the lamp back as he, the carpet, and Aladdin fall back into the cave just as it closes.
In the collapsed cave, Aladdin rubs the lamp, unexpectedly unleashing a genie, who reveals he will grant Aladdin three wishes—with the exception of murder, romance, revival of the dead or multiplication of wishes. Aladdin doubts there is a genie, thinking he may have suffered head trauma, so the Genie launches into a song of “Never Had a Friend Like Me”, then finally convinces Aladdin by freeing him, Abu and the Carpet from the cave. Genie realizes he used magic without actually granting a wish, to which he says Aladdin will get no more magic help unless he expressly states “I wish”. While contemplating his wishes, Genie admits he would wish for freedom, since he is a prisoner to his lamp. Aladdin promises to free the Genie as his last wish. After talking about Jasmine with the Genie, Aladdin decides to use his first wish to become a prince so he can woo Jasmine.
Aladdin returns to Agrabah just as Jafar tries to trick the Sultan into arranging a marriage between himself and Jasmine. When Aladdin parades into the Sultan’s palace as “Prince Ali”, Jasmine rejects Ali as a suitor. Despite the Genie’s suggestion that Aladdin to tell the princess who he really is, Aladdin keeps up his act as a suave prince, and takes Jasmine around the world on the magic carpet. During the trip, Jasmine believes Ali to be the peasant man she saw earlier, Aladdin, and demands the truth from him. Aladdin instead fabricates a story that he sometimes dresses as a commoner to escape palace life. The couple kisses as Aladdin returns her home.
Afterwards, Aladdin is captured by Jafar and thrown into the ocean, but the Genie rescues Aladdin as his second wish. Aladdin returns to the palace and exposes Jafar’s plot; and Jafar flees after noticing the lamp in Aladdin’s possession, realizing who Aladdin is. As Aladdin gets doubtful about revealing who really is, Iago steals the Genie’s lamp and brings it to Jafar, who becomes the Genie’s new master. Jafar uses his first two wishes to become Sultan and the most powerful sorcerer in the world. Using his new powers, Jafar forces Jasmine and her father to bow, exposes Aladdin as a street rat, then exiles him and Abu to a frozen wasteland.
Aladdin uses the magic carpet to return to Agrabah, where Jafar has imprisoned both Jasmine and the Sultan as his slaves. Jasmine distracts Jafar with a seductive act as Aladdin tries to steal back the lamp, but Jafar confronts him. He imprisons Jasmine in a large hourglass and turns himself into an enormous cobra. As Jafar traps Aladdin in his coils, he boasts to be “the most powerful being on Earth”, which causes Aladdin to shout out that the Genie is more powerful. Faced with this realization, Jafar uses his final wish to become a genie. However, Jafar discovers that genies are not free entities as he is sucked into a black lamp, dragging Iago with him. The Genie flicks the lamp into the Cave of Wonders.
After Aladdin realizes that he cannot keep pretending to be something he is not, he decides to keep his promise and wish for the Genie’s freedom. Seeing Jasmine’s love for Aladdin, the Sultan changes the law to allow her to marry whomever she deems worthy. The newly free Genie leaves to explore the world while Aladdin and Jasmine celebrate their engagement.