A space probe containing information about the human race is found by the alien galactic council. They debate whether to destroy the Earth or make humanity a member of the council. As a test, they will give one random human limitless power, the ability to do “absolutely anything”. After ten days, if the powers were used for evil, Earth will be destroyed.
The chosen human is Neil Clarke, a teacher struggling under Headmaster Robinson. Neil has a crush on his neighbor, Catherine West. Oblivious to his new power, Neil wishes for aliens to destroy the classroom of students hated by him, which indeed causes an alien spaceship to kill everyone in that classroom.
Perplexed, Neil tests himself to find out that he can do anything. To fix the deaths of his students he wishes that “everyone who died come back to life”, causing all dead people to rise as zombies; he reverses this and asks that the explosion never happened, which reverses all previous wishes. Next day he wishes for another teacher, Miss Pringle, to worship his friend Ray, who is too shy to tell Pringle that he likes her.
Neil uses his power for petty personal gains and to give his dog Dennis the ability to speak. One night, the galactic power fails to make Catherine fall in love with Neil, but then coincidentally Catherine knocks at his door. They spend the night together and are seen by Catharine’s stalker ex-boyfriend, Colonel Grant.
Catherine hears Dennis shouting that he loves Neil, making her think that Neil has a gay boyfriend. Ray says that Miss Pringle doesn’t love him romantically, instead she worships him as a god. Catherine locks Grant in her apartment. Neil breaks Grant’s arm and then fixes it, revealing his ability to grant wishes whenever he says a wish and makes a hand gesture. Grant kidnaps Neil, tying his hand and gagging him to prevent his escape, and then forces him to grant some selfish or absurd wishes (such as giving all native English people huge ears and duck feet), threatening to shoot Dennis.
Catherine and Ray rescue Neil who reverses all of the wishes, including Miss Pringle’s now violently fanatical worship of Ray, who was close to being ritually killed by her and the cult she created. Catherine angrily tells Neil that she could never love anyone so controlling. Disheartened, Neil decides to use his powers to solve the world’s problems; he grants everyone in the world as much food as they want, says that wars shouldn’t happen for any reason, grants every person their own dream house and wishes for the reversion of global warming.
However, this backfires when worldwide obesity flares, all land is taken over for houses, several countries declare war for no reason (as opposed to “any reason”), and the planet falls into a global ice age. Neil reverses all these wishes. Disheartened with his personal life and futile attempts to make the world a better place he attempts suicide, but as he jumps into the Thames, Dennis jumps in after him and Neil is forced to rescue the dog and by consequence himself. Afterward, Dennis says that Neil should give the power to him, as he never thinks of anything selfish. Neil does so.
Meanwhile, the aliens decide that Earth is not worthy. It turns out that the galactic council has a different morality than humans – they see dominance as good, and weakness as evil, with Neil trying to end wars and make the life of others better being a sign of weakness. They decide to destroy Earth, but Dennis wishes that the source of power be destroyed, causing the doom weapon of the council to bounce back to the alien ship, killing them all. With no power left, but full of confidence, the next day Neil asks Catherine out, to which she agrees.