Jafar, Grand Vizier to the Sultan of the fictional sultanate of Agrabah attempts to retrieve a magical oil lamp containing a genie from the Cave of Wonders. He has a petty thief enter the cave and retrieve it, but his plan fails. Jafar and his parrot assistant, Iago, realize that a “Diamond in the Rough” can enter the cave. Meanwhile, 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 pet, Abu, and the two begin to form a friendship. After Jafar has Aladdin captured, Jasmine orders his release but Jafar tricks her into thinking Aladdin was sentenced to death.
Disguised as an elderly man, Jafar releases Aladdin and Abu from the dungeon and leads them to the Cave of Wonders, promising a reward in return for retrieving the lamp. The cave allows them to enter but instructs them to touch nothing but the lamp. Aladdin and Abu find a magic carpet. Aladdin obtains the lamp but Abu’s attempt to steal a gem fails and causes the cave to collapse. The carpet flies them back to the entrance and Aladdin delivers the lamp to Jafar, who attempts to kill him. Abu thwarts Jafar and steals back the lamp as he, the carpet, and Aladdin fall back into the cave before it closes.
In the collapsed cave, Aladdin rubs the lamp, inadvertently unleashing the Genie, who reveals he will grant Aladdin three wishes with the exception of murder, romance, revival of the dead or additional wishes. Aladdin tricks the genie into magically freeing himself, Abu, and the carpet from the cave without actually using a wish; thereafter, the Genie states that Aladdin will not receive anymore magic help unless he explicitly states “I wish”. While contemplating his wishes, the 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. Aladdin decides to use his first wish to become a prince in order to be legally able to court Jasmine.
Meanwhile, Jafar attempts to mind control the Sultan into arranging a marriage between himself and Jasmine in order to become Sultan himself. Before he is able to succeed, Aladdin appears and parades into the Sultan’s palace as “Prince Ali of Ababwa”. Sultan is impressed but Jasmine declines Ali as a suitor. Despite the Genie’s suggestion that Aladdin to tell the princess his real identity, Aladdin keeps up his act as a prince and takes Jasmine around the world on the magic carpet. Jasmine suspects that Ali is actually the man she met in the marketplace; during the trip, she tricks Aladdin into revealing it and demands the truth from him. Aladdin fabricates a story that he sometimes dresses as a commoner to escape palace life. The couple kisses as Aladdin returns her home.
Afterwards, Jafar captures Aladdin and attempts to drown him before making a second attempt to arrange a marriage. The Genie rescues Aladdin as his second wish; Aladdin returns to the palace and exposes Jafar’s plot. Jafar flees after noticing the lamp in Aladdin’s possession, realizing who Aladdin is. Aladdin has second thoughts about freeing the Genie, believing that without him he is “just Aladdin”. Iago steals the lamp and brings it to Jafar. Jafar becomes the Genie’s new master, using his first two wishes to usurp the Sultan’s throne and become the most powerful sorcerer in the world. Using his new powers, Jafar enslaves Jasmine and the Sultan, exposes Aladdin as a street rat, then exiles him and Abu to a frozen wasteland.
Aladdin and Abu use the magic carpet to return to the palace, where Aladdin sneaks in to recapture the lamp. Jafar proposes using his third wish to have Jasmine fall in love with him. The Genie protests that he cannot grant that wish, but Jasmine feigns interest in Jafar, allowing Aladdin to attempt to grab the lamp. Aladdin gets caught and battles Jafar, who transforms himself into an enormous cobra and traps Aladdin. Jafar says that he is “the most powerful being on Earth”, but Aladdin argues that the Genie is more powerful. Faced with this realization, Jafar uses his final wish to become a genie himself. However, he then discovers that genies are not free entities as he is sucked into a lamp of his own, dragging Iago with him. The Genie sends Jafar’s lamp flying into the Cave of Wonders and urges Aladdin that he should use his third wish to regain his princeship, warning Aladdin that he has never seen a woman like Jasmine. Realizing that he cannot keep pretending to be something he is not, Aladdin decides to keep his promise and wish for the Genie’s freedom. After discovering 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.