In 1982, young Albert Weinselstein is harassed by bullies. His mother gives him a special magic trick set by veteran magician Rance Holloway as his birthday present. He studies the instructional video and begins to practice some tricks, attracting the attention of a classmate, Anthony Mertz. They practice together and eventually become professional magicians Burt Wonderstone and Anton Marvelton, earning them success and an ongoing headlining act at the Bally’s Hotel in Las Vegas. However, after ten years of performing the same tricks over and over again, Burt has become an overconfident, egocentric prima donna, and Anton begins to get fed up with Burt’s ego, which has already cost them previous female assistants, all called “Nicole” in the act. In a rush, Burt enlists production assistant Jane as the new Nicole.
Burt and Anton encounter up-and-coming street magician Steve Gray performing a unique yet disturbing card trick for his TV magic show, Brain Rapist. Audience numbers soon dwindle at Burt and Anton’s show, upsetting Bally’s owner Doug Munny. Taking a cue from Gray’s endurance-based stunts, Anton suggests that he and Burt try a similar tack—locking themselves in a Plexiglas cage called the “Hot Box” hung above ground. Overconfident, Burt does not prepare for the stunt and almost instantly falls into a panic, causing the stunt to fail and injuring Anton. Anton angrily ends his partnership with Burt, and Jane also quits.
Burt refuses to change his act, staging his two-man show alone to disastrous results. Munny shuts down the production and Burt, having squandered his earnings over the years, is left broke. Despondent, Burt tries to find work and is eventually hired as an entertainer at an assisted-living facility catering to former Vegas entertainers. There he meets Holloway, who retired several years before because he found that he was no longer happy performing. Holloway counsels Burt about magic, inspiring him to remember the initial wonder that led him to become a magician. Burt is shocked to see Jane—herself an aspiring magician—working for Gray. Appalled by Gray’s style, Holloway and Burt polish their own tricks. Jane visits her grandmother at the facility and patches things up with Burt.
Doug is opening a new casino-hotel and is offering a five-year contract to the winner of a talent search on the casino’s opening night. He invites Burt to do a magic show at his son’s birthday party, but Gray also appears and tries to upstage Burt with his own tricks. Disgusted by Gray’s actions, Jane leaves his show. Burt reconnects with Anton, who has been distributing magic sets in Cambodia. A drug found in Cambodia called kratom that puts users into a deep sleep gives them an idea to perform a sensational trick that they were never able to perfect: the “Disappearing Audience”.
At the talent search show, Gray’s performance involves him drilling into his brain, claiming it will not affect him. This, however, backfires, leaving Gray with brain damage. Holloway then introduces Burt, Anton, and Jane’s performance before they secretly sedate the audience with kratom sleeping gas and then transport them to an outside location in the same seating arrangement. The audience awakes and responds with awe, and Doug awards the headlining act to Burt and Anton; they ask Jane to be their opening act. The trio then performs the Disappearing Audience trick again, returning everyone to the casino theater, as the now mentally-impaired Gray watches on with the drill bit still in his skull.
As the film ends, the final scene shows how Burt, Anton, Holloway and others transported the audience to the open area, by unceremoniously dragging and transporting the unconscious audience members to the area, and hauling them back to the theater in a moving van.