Theo Moses is an aspiring young magician coping with the death of his father. His mother reveals his acceptance video from the Institute of Magic, a summer camp run by the eccentric Roy Preston; assuming his father applied for him, Theo agrees to attend. Andy Duckerman is a down-on-his-luck former magician with a grudge against the famous Kristina Darkwood, who has a successful solo act on the Las Vegas strip. Preston persuades Andy, his former student, to return to camp as a counselor alongside Darkwood.
At camp, the students are split into four different cabins to face each other in the end-of-year Top Hat competition, where one student will win the coveted Golden Wand. Andy is assigned to lead the Hearts cabin, including Theo; allergy-prone Nathan Jenkins; rabbit-obsessed Ruth Brusselbach; Judd Kessler, the less talented son of a famous magician; and antisocial Vera Costa. Darkwood leads the Diamonds, including previous Golden Wand winner and bully Vic d’Antonio, and Janelle Santos, who takes a liking to Theo.
The inexperienced Hearts struggle to learn magic, and a frustrated Andy almost quits, but discovers that Theo has a gift for card tricks. Determined to beat Darkwood, Andy helps the Hearts realize their hidden talents: Judd embraces costume design, Ruth has an affinity for birds over bunnies, Nathan can perform impressive mental calculations, and Vera begins to make friends. Helping Theo overcome his stage fright, Andy reveals that he and Darkwood met as campers, and became a couple as well as magic partners; she accepted a television deal behind his back, and her career took off while he fell into obscurity.
Darkwood convinces Janelle, whose wealthy parents send her to various camps instead of spending time with her, to give magic a chance. Attempting to humiliate Nathan, Vic is outdone by Theo and seemingly burns Theo’s cards – a gift from his father, who introduced him to magic. Distraught, Theo bonds with Andy and his fellow Hearts, as well as Janelle. After the Diamonds check out all the camp’s props for themselves, Andy takes the Hearts into town to train with whatever they can find, and the young magicians perform their acts in public.
Andy confronts Darkwood, who already reprimanded her team, and she reveals the truth behind their falling out: she tried to negotiate a deal for both of them, which he never gave her a chance to explain. She has booked him a matinee in Vegas for the next day; with Preston’s encouragement, Andy accepts, knowing he will miss the Hearts’ training but be back in time for the Top Hat competition that night. Preston informs the Hearts that Andy has gone to Vegas, but after his successful matinee, Andy is invited to perform the evening show – at the same time as the competition.
The students’ families, including Janelle’s parents, arrive for the competition. Without Andy there, a nervous Theo is encouraged by Preston, who shows him the supportive video Theo’s mother submitted as his application. Andy – having turned down the Vegas show – watches his team perform, and deduces that Preston arranged everything to restore Andy’s love for magic. Theo conquers his fears to give the final performance, a heartfelt card trick thanking his family for their support. The Hearts win the Top Hat, and Janelle is awarded the Golden Wand.
Andy is hired to be the camp’s year-round talent director, and reconciles with Darkwood, who agrees to teach with him if he performs at her Vegas show on occasion. Vic apologizes to Theo and returns his unharmed cards; Judd’s father proudly accepts that he is a talented designer, rather than a magician; Ruth finally holds a rabbit while forming a close friendship with Vera; and Janelle and Theo share a kiss. The film ends with a new Institute of Magic video headed by Andy.