The most prolific Olympic gold medalist of all time, with 14 to his name, will be 27 in 2012.
"I told myself I will not swim over the age of 30, and I will not," he says in the BBC Sport report.
Phelps has not specified how many races he will enter in London, but said he hopes his refusal to wear the now-banned high-tech suits will give him an edge.
He said: "Swimming is going to be swimming again; it's not going to be who is wearing what suit."
Phelps was a bitter opponent of the use of high-tech swimsuits at the World Championships in Rome in 2009, where he lost his 200-meter freestyle world record to Germany's Paul Biedermann.
The sport's world governing body FINA has since banned the suits and Phelps said it will be "interesting" to see how competitions will go.
He added: "You're really going to be able to see who wants to work and who wants to make sure who stays on top."
Phelps, who is in the middle of a visit to the Winter Olympics in Vancouver, won six gold medals at Athens in 2004 and a further eight in Beijing in 2008.
He ruled out entering eight races in London but plans to use this year's Pan Pacific Championships in California and the 2011 World Championships in Shanghai to experiment with different combinations of events ahead of the Games.
"I don't even know," he said when asked how many races he would enter in London. "But I will say it's not eight, I'll give you that one."
Phelps told the Vancouver Sun he was enjoying being a spectator at an Olympic event, rather than a competitor.
"I've competed at three Summer Olympics, and it's nice to see the other side of it," he said. "You know what they're going through because you've lived it, so to see how they react and compete is really special."