Wiles states that he came across Fermat's Last Theorem on his way home from school when he was 10 years old. He stopped at his local library where he found a book about the theorem.[10] Fascinated by the existence of a theorem that was so easy to state that he, a ten year old, could understand it, but that no one had proven, he decided to be the first person to prove it. However, he soon realised that his knowledge was too limited, so he abandoned his childhood dream, until it was brought back to his attention at the age of 33 by Ken Ribet's 1986 proof of the epsilon conjecture, which Gerhard Frey had previously linked to Fermat's famous equation.[11]

His biographical page at Princeton University's website states that "Andrew has few equals in terms of his impact on modern number theory. Many of the world’s very best young number theorists received their Ph.D.'s under Andrew ... and many of these are today leaders and professors at top institutions around the world".[14]

Starting in mid-1986, based on successive progress of the previous few years of Gerhard Frey, Jean-Pierre Serre and Ken Ribet, it became clear that Fermat's Last Theorem could be proven as a corollary of a limited form of the modularity theorem (unproven at the time and then known as the "Taniyama–Shimura–Weil conjecture"). The modularity theorem involved elliptic curves, which was also Wiles's own specialist area.[15]

The conjecture was seen by contemporary mathematicians as important, but extraordinarily difficult or perhaps impossible to prove.[16]:203–205, 223, 226 For example, Wiles's ex-supervisor John Coates states that it seemed "impossible to actually prove",[16]:226 and Ken Ribet considered himself "one of the vast majority of people who believed [it] was completely inaccessible", adding that "Andrew Wiles was probably one of the few people on earth who had the audacity to dream that you can actually go and prove [it]."[16]:223

Despite this, Wiles, with his from-childhood fascination with Fermat's Last Theorem, decided to undertake the challenge of proving the conjecture, at least to the extent needed for Frey's curve.[16]:226 He dedicated all of his research time to this problem for over six years in near-total secrecy, covering up his efforts by releasing prior work in small segments as separate papers and confiding only in his wife.[16]:229–230

In June 1993, he presented his proof to the public for the first time at a conference in Cambridge.

He gave a lecture a day on Monday, Tuesday and Wednesday with the title 'Modular Forms, Elliptic Curves and Galois Representations.' There was no hint in the title that Fermat's last theorem would be discussed, Dr. Ribet said. ... Finally, at the end of his third lecture, Dr. Wiles concluded that he had proved a general case of the Taniyama conjecture. Then, seemingly as an afterthought, he noted that that meant that Fermat's last theorem was true. Q.E.D.[17]

In August 1993, it was discovered that the proof contained a flaw in one area. Wiles tried and failed for over a year to repair his proof. According to Wiles, the crucial idea for circumventing, rather than closing, this area came to him on 19 September 1994, when he was on the verge of giving up. Together with his former student Richard Taylor, he published a second paper which circumvented the problem and thus completed the proof. Both papers were published in May 1995 in a dedicated issue of the Annals of Mathematics.[18][19]

Wiles's proof of Fermat's Last Theorem has stood up to the scrutiny of the world's other mathematical experts. Wiles was interviewed for an episode of the BBC documentary series Horizon[20] that focused on Fermat's Last Theorem. This was renamed "The Proof", and it was made an episode of the US Public Broadcasting Service's science television series Nova.[10] His work and life are also described in great detail in Simon Singh's popular book Fermat's Last Theorem.

Wiles has been awarded a number of major prizes in mathematics and science:

Andrew Wiles is almost unique amongst number-theorists in his ability to bring to bear new tools and new ideas on some of the most intractable problems of number theory. His finest achievement to date has been his proof, in joint work with Mazur, of the "main conjecture" of Iwasawa theory for cyclotomic extensions of the rational field. This work settles many of the basic problems on cyclotomic fields which go back to Kummer, and is unquestionably one of the major advances in number theory in our times. Earlier he did deep work on the conjecture of Birch and Swinnerton-Dyer for elliptic curves with complex multiplication – one offshoot of this was his proof of an unexpected and beautiful generalisation of the classical explicit reciprocity laws of Artin–Hasse–Iwasawa. Most recently, he has made new progress on the construction of ℓ-adic representations attached to Hilbert modular forms, and has applied these to prove the "main conjecture" for cyclotomic extensions of totally real fields – again a remarkable result since none of the classical tools of cyclotomic fields applied to these problems.[22]