Originally, Jafar was more hot-tempered while Iago was a cool, haughty British-type. The filmmakers felt that having Jafar losing his temper too much made him less menacing, so the personalities of the two characters were switched.
During the course of recording the voices, the late Robin Williams improvised so much they had almost sixteen hours of material.
Because Robin Williams ad-libbed so many of his lines, the script was rejected for a Best Adapted Screenplay Academy Award nomination.
When Robin Williams died in 2014, Disney honored him that week by airing Aladdin on their three children's channels (Disney Channel, Disney XD, and Disney Junior) across three days, twice on each channel. At the end of the movie, just before the credits, they put up an image that read, "In Memory of Robin Williams, who made us laugh." using animator Eric Goldberg's tribute to him as a backdrop.
The opening scene with the street merchant was completely unscripted. Robin Williams was brought into the sound stage and was asked to stand behind a table that had several objects on it and a bedsheet covering them all. The animators asked him to lift the sheet, and, without looking, take an object from the table and describe it in character. Much of the material in that recording session was not appropriate for a Disney film.