In 1969, shortly before leaving the series, producer Peter Bryant cast Pertwee as the Third Doctor in Doctor Who. Pertwee had asked his agent to apply for the role for him and was surprised to find he was already on the shortlist. He was the second choice for the role; Ron Moody was the first but was unavailable.
In a departure from the Doctor's first two incarnations, Pertwee's era was influenced by the James Bond film series. He played the character as an active crusader with a penchant for action and fancy clothes, while the character was exiled to Earth by the Time Lords for much of his tenure and serving as the scientific adviser to Brigadier Lethbridge-Stewart and UNIT. He played the Doctor for five seasons from early 1970 to mid-1974, a longer stint than either of his predecessors in the role, although he ultimately appeared in fewer episodes than William Hartnell as the BBC had reduced the production schedule. Pertwee credited his performance as the Doctor with helping him work out exactly who he really was when he was not resorting to comedic disguises or voices: a dapper, technologically oriented man of action. This was because the BBC's Head of Drama, Shaun Sutton, had advised him to act the Doctor as himself: in effect, to "play Jon Pertwee". On 14 April 1971, Pertwee was the subject of Thames Television's This Is Your Life.
During his tenure as the Doctor, Pertwee appeared in the Amicus horror compendium The House That Dripped Blood (1971), which was filmed in the summer of 1970 between his first and second Doctor Who seasons. Pertwee played the lead in the last segment of the film as Paul Henderson, an arrogant horror film star who meets his doom thanks to a genuine vampire cloak. In 1973 Pertwee endorsed the Co-op's Baking Your Cake and Eating It, a recipe book written by Sarah Charles. It has been given the unofficial title of The Jon Pertwee Recipe Book.
In early 1974 Pertwee announced he would step down as the Doctor to resume his stage career in The Bedwinner, also citing potential typecasting in the role as the reason for leaving, though he later said that the catalyst for his departure was the death of his good friend and co-star Roger Delgado (The Master) and the departures of co-star Katy Manning and producer Barry Letts. His last full-time appearance in the series was in the story Planet of the Spiders in June 1974, which finished with Tom Baker replacing him in the role.
Pertwee later reprised the role in the 20th anniversary story The Five Doctors and the Children in Need story Dimensions in Time, in two radio adventures and on stage in Doctor Who – The Ultimate Adventure.