According to the director Pete Docter, each emotion is based on a shape: Joy is based on a star, Sadness is a teardrop, Anger is a fire brick, Fear is a raw nerve, and Disgust is broccoli. He noted that he likes broccoli very much, however.
Some memory balls in Riley's mind contain scenes from other Pixar movies, such as Carl and Ellie's wedding in Up (2009).
The writers considered up to 27 emotions but settled on five (Joy, Sadness, Disgust, Fear, and Anger) to make it less complicated. Some primary emotions that were cut included Surprise, Pride, and Trust.
When Pete Docter and Jonas Rivera pitched the film to Mindy Kaling, she was moved to tears and said, "I think it's great that you guys are making a film that shows it's difficult to grow up, and that it's okay to be sad about it." According to Pete Docter, they exclaimed, "Quick! Write that down!"
Originally, Joy would team up with Fear rather than Sadness. The creators thought they would be the funnier pairing. They went with Sadness instead when Pete Docter was on a Sunday walk and then had a bad train of thought. He feared he'd get fired and lose his friends. Because of this, he realized Joy needed to know it was okay for Sadness to be at the controls occasionally.