American astronaut Tony Nelson splashes down near a deserted island and finds a bottle that contains a beautiful genie named Jeannie. After helping him get rescued he sets her free, but she prefers to come home with him. Besides she is very much in love with her handsome master and she will grant his every wish or desire no matter how much trouble he gets in.
Tony has a lot of work and doesn't have time for Jeannie. However, it is the day of Ramdah when masters must journey to Mecca to recite the ancient words or their genie will lose her powers and disappear.
Tired of Jeannie using her magic around the house he asks Jeannie to promise to not use her magic for him again. Next thing he knows is that he is captured by Red Chinese spies and all Jeannie can do is watch.
When Tony has to escort a princess around, Jeannie announces that due to a family feud she has to kill her. To save the princess Tony sends Jeannie around the world with tasks so massive that she will miss the three days of her visit.
Roger convinces Tony that "The Tales of the Arabian Nights" would be a good manual on how a genie should act to his master. Tony tells Jeannie to read it, but Roger didn't let him know that it was about stories of genies who torture their masters.
Jeannie writes a book on childcare using Tony's name that becomes a bestseller. As a result, he has to babysit Doctor Bellow's unruly nephew and General Peterson's incredibly shy granddaughter who refuses to talk.
After Tony accepts a job in the private sector, Roger and Jeannie look into his future, which is very successful. They fool him into thinking it will be horrible but he still takes the job as he feels that the aerospace industry needs him.
Tony is sent back in time to deal with Captain Kidd to prove his bravery. A British aristocrat named Lady Diane Nelson is being held prisoner on the ship. As she is one of his ancestors, he must save her life or he'll cease to exist.
Learning that genies lose their powers if they marry a mortal, Tony proposes to Jeannie. After Roger and Jeannie learn that their children might get magical powers, Jeannie keeps Roger away so that Tony won't learn that little fact.
While hiding in a safe destined for the Moon, Jeannie ends up locked inside. Tony and Roger hire a safe cracker and his helper to get her out. Unfortunately, it appears the safe ends up on the rocket and on its way to the Moon.
It turns out that Roger switched boxes and the safe didn't go to the Moon. Unwilling to take the risk of setting off the explosives, the safe crackers pay a pawnbroker to take it off their hands. She in turn sends it to a scrapyard.
Jeannie tells Tony that, as a full moon has passed since she became trapped, whoever opens the safe will become her new master. NASA gets an expert to open the safe as the explosive component is not working and it is going to detonate.
Tony makes a bet with Roger that Jeannie would never fall for another man. This leads to Tony disguising himself as a British officer. However, things get complicated when Jeannie falls for the "British" officer and Tony becomes jealous.
While picking up items for her charity auction at Major Nelson's house, Amanda Bellows finds a friendly little stray dog and decides to adopt it. Later on, the dogs turns invisible and terrorizes half of NASA, convincing Major Nelson that it is Jeannie's long lost dog, Djinn Djinn.
Jeannie II returns and says that she can finally help her sister get Tony to marry her. She shows her how easy it is to get a man to fall in love without the aid of magic. To this end Jeannie II uses Roger as her guinea pig. Eventually she gets Roger to propose, and when Jeannie tries to use the same technique on Tony she fails miserably. However, it turns out that this is just another scheme by Jeannie II to finally get Tony into her clutches.
Roger accidentally finds out that Tony has been replaced by a double and races to Tony's house to prevent the double from not only marrying Jeannie, but to prevent Doctor Bellows from finding out about her. They are successful on both fronts, but still have no clue as to where the real Tony is. However, it is revealed that the impostor Tony is also a double agent working for a foreign power sent to steal the project the real Tony was working for. Things really get complicated when the real Tony returns home.
People start visiting the house after Jeannie puts up a 'for sale' sign because she wants Tony to spend more time with her. Tony says that he doesn't want anyone else to see that house so she makes it invisible.
When Tony and Roger are trying to make a spacecraft fly, Jeannie does it with one blink. Tony tells her to get rid of it so she gives it to a boy in the park that has an inventor father. Tony gets accused of selling government secrets.
Both Tony and Jeannie are trying to play matchmaker with single Roger. Tony tries to match him with General Schaeffer's niece, who turns out a big surprise. Jeannie tries a computer dating service, which also turns out unexpectedly.