During the course of recording the voices, the late Robin Williams improvised so much they had almost sixteen hours of material.
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.
Because Robin Williams ad-libbed so many of his lines, the script was rejected for a Best Adapted Screenplay Academy Award nomination.
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.
While recording this movie, Robin Williams frequently received calls from Steven Spielberg, who at the time was working on the Holocaust film La Lista de Schindler (1993). He would put him on speaker phone so he could tell jokes to the cast and crew to cheer them up. Some of the material that he used was material that he was using for this film.