Jafar, a wicked sorcerer and royal vizier of the Middle Eastern city of Agrabah, seeks a magic oil lamp hidden inside the Cave of Wonders, and is told that only a "diamond in the rough" can enter, who he later identifies as the young street thief Aladdin. Meanwhile, Princess Jasmine, the daughter of the Sultan, is upset that she must marry out of obligation to the kingdom's laws rather than out of love and runs away from home. While in the market, she meets Aladdin, who saves her from an angry merchant, and his monkey Abu.
As a bond develops between the two, Aladdin is captured by the guards and sent to prison, where he meets Jafar, who has disguised himself as an elderly beggar. Freeing them, Jafar leads Aladdin and Abu to the Cave of Wonders where they are told not to touch anything but the lamp. Inside the cave, Aladdin finds the lamp and a magic carpet, but when Abu touches a gemstone, the cave collapses. Trapped in the cave, Aladdin rubs the lamp-which Abu had stolen from Jafar-and frees the Genie living inside it. Genie grants Aladdin three wishes, but he tricks him into helping them escape the cave without making a wish. When he learns of Genie's desire to be free, Aladdin promises to save his last wish to help him, and uses his first one to become a prince and court Jasmine.
Disguised as "Prince Ali Ababwa", Aladdin meets the Sultan, Jafar and Jafar's parrot Iago, arriving with a large host, and angers Jasmine when she overhears him talking to her father and Jafar about her future marriage. To make it up to her, Aladdin takes the princess on a magic carpet ride. When she infers his true identity, he lies that he pretends to be a commoner to escape the stresses of royal life. After taking Jasmine home, Aladdin is captured by the guards on Jafar's orders and left to drown in the sea. Aladdin summons the Genie, who saves him, but at the cost of his second wish. Returning to the castle, Aladdin exposes Jafar's treachery and the sorcerer escapes, but not before he discovers the street rat has the lamp.
Fearing his lie will be exposed, Aladdin reneges on his deal to free Genie, to his best friend's anger. Iago steals the lamp, and Jafar becomes Genie's new master, using his first wish to become Sultan, and his second to become the world's most powerful sorcerer; he uses his magic powers to expose Aladdin as a fraud, and banishes him, Abu and the magic carpet to a frozen wasteland. The three return to the kingdom where Jafar has captured Jasmine, and transforms himself into a giant king cobra to finish Aladdin off. Our hero then goads the sorcerer into using his last wish to become a genie, but learns too late that being a genie not only comes with "phenomenal, cosmic power", but an "itty, bitty living space", and he and Iago are dragged into a black lamp and cast into the desert by Genie.
With Agrabah free, Aladdin decides to uphold his promise to wish for Genie's freedom, despite the latter urging him to become a prince again. Recognizing the street rat's nobility, the Sultan decides to change the kingdom's laws so Jasmine and Aladdin can marry. Genie celebrates his newfound freedom by traveling the world, and Aladdin and Jasmine embark on their new life together.