The Book of Mormon was conceived by Trey Parker, Robert Lopez, and Matt Stone. Both Parker and Stone grew up in Colorado, and were somewhat familiar with the Mormon church and its members. Parker had an extensive background in music before meeting Stone; in high school, he was in the chorus of a community theater production of The Best Little Whorehouse in Texas, was piano player for the chorus as well as president of Choir Counsel. He also performed in productions of Grease and Flower Drum Song, and helped build the set for the community theater production of Little Shop of Horrors. The writers became friends at the University of Colorado at Boulder. At the college, they collaborated on a musical film, Cannibal! The Musical (1993), their first experience with musicals. In 1997, they created the TV series South Park for Comedy Central and the 1999 musical film South Park: Bigger, Longer & Uncut. The two had first thought of a fictionalized Joseph Smith, religious leader and founder of the Latter Day Saint movement, while working on an aborted Fox series about historical characters. Their 1998 film, Orgazmo, and the 2003 episode "All About Mormons" of South Park both gave comic treatment to Mormonism.
During the summer of 2003, Parker and Stone flew to New York City to discuss the script of their new film, Team America: World Police, with friend and producer Scott Rudin (who also produced South Park: Bigger, Longer & Uncut). Rudin advised the duo to see the musical Avenue Q on Broadway, finding the cast of marionettes in Team America similar to the puppets of Avenue Q. Parker and Stone went to see the production during that summer, and Lopez, writer-composer of Avenue Q, noticed them in the audience and introduced himself. Lopez revealed that South Park: Bigger, Longer & Uncut was highly influential in the creation of Avenue Q. The trio went for drinks afterwards, and soon found that each camp wanted to write something involving Joseph Smith. The three began working out details nearly immediately, with the idea to create a modern story formulated early on. For research purposes, the trio took a field trip to Salt Lake City where they "interviewed a bunch of missionaries—or ex-missionaries." They had to work around Parker and Stone's South Park schedule. In 2006, Parker and Stone flew to London where they spent three weeks with Lopez, who was working on the West End production of Avenue Q. There, the three wrote "four or five songs" and came up with the basic idea of the story. For the next few years, the trio met frequently to develop what they initially called The Book of Mormon: The Musical of the Church of Jesus Christ of Latter-day Saints. "There was a lot of hopping back and forth between L.A. and New York," Parker recalled.
Lopez pushed for the stage, and his partners concurred. Lopez prodded them to take the project a step further and "workshop" it, which baffled Parker and Stone, clueless about what he meant. Developmental workshops directed by Jason Moore starred Cheyenne Jackson. Other actors in readings included Benjamin Walker and Daniel Reichard. The crew embarked on the first of a half-dozen workshops that would take place during the next four years, ranging from 30-minute mini-performances for family and friends to much larger-scale renderings of the embryonic show. They spent hundreds of thousands of dollars of their own money, still unconvinced they would take it any further. In February 2008, a fully staged reading starred Walker and Josh Gad as Elders Price and Cunningham, respectively. Moore was originally set to direct, but left the production in June 2010. Other directors, including James Lapine, were optioned to join the creative team, but the producers recruited Casey Nicholaw. A final five-week workshop took place in August 2010, when Nicholaw came on board as choreographer and co-director with Parker.
Rudin was named as the producer of the show. Originally, Rudin planned to stage The Book of Mormon off-Broadway at the New York Theater Workshop in Summer 2010, but opted to premiere it directly on Broadway, "[s]ince the guys [Parker and Stone] work best when the stakes are highest." Rudin booked the Eugene O'Neill Theatre and hired key players while sets were designed and built. Rudin expected the production to cost $11 million, but it came in under budget at $9 million. Hundreds of actors auditioned and 28 were cast. When a rehearsal space was found, the work of producing a full-blown musical got under way. Parker and Stone, along with their families, decamped from Los Angeles to New York City shortly after the completion of South Park's fourteenth season in November 2010. The cast and crew then frantically delved into rewrites and rehearsals. The crew did four weeks of rehearsals, two weeks of 'tech', and then went directly into previews. The producers only heard the musical with a full orchestra a mere six days before the first paying audience.