In Atlanta, Dave is married with three kids, while his friend Mitch is single and at his sexual prime. After getting drunk at a bar, Mitch and Dave urinate into a fountain, simultaneously wishing they had each other's lives.
The next morning, Mitch and Dave realize they have switched bodies. They return to the park to wish for their lives back, but the fountain has been removed for restoration. Forced to wait until the parks department locates the fountain, Mitch and Dave agree to pose as each other. At Dave's law office, Mitch befriends Dave’s assistant Sabrina, but his lack of professionalism and legal knowledge sabotage an important merger with a Japanese firm. Dave arrives at Mitch's film shoot, discovering it is a "lorno" – "light" pornography.
Dave takes Mitch to tell his wife Jamie the truth, but Jamie does not believe him. Dave advises Mitch on how to behave professionally, and Mitch sets up Dave on a date with Sabrina, on whom Mitch has a crush.
After speaking with his father, Mitch rededicates himself to Dave's life. At her ballet recital, Dave’s eldest child Cara takes Mitch's advice and throws her bully to the floor, to which Mitch foul-mouthedly cheers. Cara tells Mitch that she loves him and Mitch says the same, but feels guilty.
Dave takes the day off to take full advantage of being Mitch, who coaches him how to act like Mitch on the date, and shaves off Dave's pubic hair. Sabrina meets Dave at a classy restaurant and, despite only going because Mitch told her to, genuinely likes him, and they get tattoos. Dave walks Sabrina home, and she tells him to call her.
Mitch learns Dave previously told Jamie not to invite Mitch to their anniversary party, afraid he would ruin it with his usual antics. Dave informs Mitch the fountain has been found, but they both imply they want to stay as each other. Mitch, forgetting about the “Dialogue Night” he planned with Jamie, accidentally stands her up.
At the new merger meeting, the Japanese representatives only offer $625 million, $75 million short. As Dave’s firm is about to agree, Mitch observes that the other representatives have not yet left, and compares the negotiations to sex and porn. He demands $725 million and has the representatives of Dave's firm begin to leave, scaring the other firm into agreement. Mitch and Dave's family go to a gala held by Dave's firm in honor of Dave being made partner, but Jamie is upset, knowing Dave will never truly be happy.
Dave and Sabrina are at a baseball game when a thunderstorm hits, and wait it out at Mitch's house. Sabrina tells Dave she is going to have sex with him, but he notices her tattoo of a many-spotted skipperling – his daughter’s favorite butterfly – and regretfully leaves.
At the gala, Dave’s boss delivers a speech about Dave’s accomplishments and his love for his family, filling Mitch with guilt. Dave rushes in and kisses Jamie, finally convincing her that he is her husband. He and Mitch find the fountain in the center of the Peachtree Galleria, surrounded by people. Proceeding with their plan to urinate in the fountain, Mitch is too embarrassed, especially after the crowd notices Dave doing so. Mitch asks why Dave did not invite him to his anniversary party, and Dave admits he was embarrassed by Mitch, but has grown to respect him while in his body. This relaxes Mitch enough to urinate, but their wish does not work. Security approaches, but on Mitch and Dave’s third try the Galleria's lights go out, and they run away.
In an epilogue, Dave and Mitch are thrilled to have returned to their original bodies. Mitch gets breakfast with Sabrina, not realizing the tattoo Dave got is of his face on Mitch's back, captioned "I ♥ Dave". Mitch speaks at his father's wedding, and attends Dave's anniversary party. In a post-credits scene, Dave and Jamie get high and visit the aquarium, while Mitch and Sabrina have sex for the first time, and Mitch sends Dave the lorno he starred in.
Ryan Reynolds as Mitchell "Mitch" Planko, Jr./David "Dave" Lockwood
Jason Bateman as David "Dave" Lockwood/Mitchell "Mitch" Planko, Jr.
Leslie Mann as Jamie Lockwood, Dave's wife
Olivia Wilde as Sabrina McKay, Dave's attractive assistant
Alan Arkin as Mitchell "Mitch" Planko, Sr., Mitch's father
Mircea Monroe as Tatiana, Mitch's nymphomaniac girlfriend
Gregory Itzin as Flemming Steel, Dave's boss
Ned Schmidtke as Theodore "Teddy" "Ted" Norton
Dax Griffin as Blow-Dried Goon
Craig Bierko as Valtan
Taaffe O'Connell as Mona
Fred Stoller as Movie Set PA
TJ Hassan as Kato
In addition, Sydney Rouviere and Lauren and Luke Bain play Dave and Jamie's children Cara, Sarah, and Peter, respectively.