Hartnell was born in St Pancras, London, England, the only child of Lucy Hartnell, an unmarried mother. He was brought up partly by a foster mother, and also spent many holidays in Devon with his mother's family of farmers, where he learned to ride. He was the second cousin of fashion designer Norman Hartnell.
Hartnell never discovered the identity of his father (whose particulars were left blank on the birth certificate) despite efforts to trace him. Often known as Billy, he left school without prospects and dabbled in petty crime. Through a boys' boxing club, at the age of 14 Hartnell met the art collector Hugh Blaker, who later became his unofficial guardian and arranged for him initially to train as a jockey and helped him enter the Italia Conti Academy. Theatre being a passion of Blaker, he paid for Hartnell to receive some "polish" at the Imperial Service College, though Hartnell found the strictures too much, and ran away.
Hartnell entered the theatre in 1925 working under Frank Benson as a general stagehand. He appeared in numerous Shakespearian plays, including The Merchant of Venice (1926), Julius Caesar (1926), As You Like It (1926), Hamlet (1926), The Tempest (1926) and Macbeth (1926). He also appeared in She Stoops to Conquer (1926), School for Scandal (1926) and Good Morning, Bill (1927), before performing in Miss Elizabeth's Prisoner (1928). This play was written by Robert Neilson Stephens and E. Lyall Swete. It featured the actress Heather McIntyre, whom he married during the following year. His first of more than 60 film appearances was in Say It With Music (1932).
At the outbreak of the Second World War, Hartnell served in the British Army in the Tank Corps, but was invalided out after 18 months as the result of suffering a nervous breakdown, and returned to acting. In 1942, he was cast as Albert Fosdike in Noël Coward's film In Which We Serve but turned up late for his first day of shooting. Coward berated Hartnell in front of cast and crew for his unprofessionalism, made him personally apologise to everyone and then sacked him. Michael Anderson, who was the first assistant director, took over the part and was credited as "Mickey Anderson".
Hartnell continued to play comic characters until he was cast in the robust role of Sergeant Ned Fletcher in The Way Ahead (1944). From then on his career was defined by playing mainly policemen, soldiers, and thugs. This typecasting bothered him, for even when cast in comedies he found he was invariably playing the 'heavy'. In 1958 he played the sergeant in the first Carry On film comedy, Carry On Sergeant, and appeared as a town councillor in the Boulting brothers' film Heavens Above! (1963) with Peter Sellers. He also appeared as Will Buckley – another military character – in the film The Mouse That Roared (1959), again with Sellers.
His first regular role on television was as Sergeant Major Percy Bullimore in The Army Game from 1957 to 1961. Again, although it was a comedy series, he found himself cast in a "tough-guy" role. He appeared in a supporting role in the film version of This Sporting Life (1963), giving a sensitive performance as an ageing rugby league talent scout known as "Dad".
After living at 51 Church Street, Isleworth, next door to Hugh Blaker, the Hartnells lived on the Thames Ditton Island. Then in the 1960s they moved to a cottage in Mayfield, Sussex. He lived in later life at Sheephurst Lane in Marden, Kent.
Hartnell's performance in This Sporting Life was noted by Verity Lambert, the producer who was setting up a new science-fiction television series for the BBC entitled Doctor Who; mainly on the strength of that performance, Lambert offered him the title role. Although Hartnell was initially uncertain about accepting a part in what was pitched to him as a children's series, in part due to his success in films, Lambert and director Waris Hussein convinced him to take the part, and it became the character for which he gained the highest profile and is now most remembered. Hartnell later revealed that he took the role because it led him away from the gruff, military parts in which he had become typecast, and, having two grandchildren of his own, he came to relish particularly the attention and affection that playing the character brought him from children. His first episode of Doctor Who aired on 23 November 1963.
Doctor Who earned Hartnell a regular salary of £315 per episode by 1966 (in the era of 48 weeks per year production on the series), equivalent to £5,292 in 2015. By comparison, in 1966 his co-stars Anneke Wills and Michael Craze were earning £68 and £52 per episode at the same time, respectively. Throughout his tenure as the Doctor, William Hartnell wore a wig when playing the part, as the character had long hair.
According to some of his colleagues on Doctor Who, he could be a difficult person to work with. Others, though, such as actors Peter Purves and William Russell, and producer Verity Lambert, spoke glowingly of him after more than 40 years. Among the more caustic accounts, Nicholas Courtney, in his audio memoirs, recalled that during the recording of The Daleks' Master Plan, Hartnell mentioned that an extra on the set was Jewish, Courtney's inference being that Hartnell was prejudiced. In an interview in 2008, Courtney claimed that Hartnell "was quite nationalist-minded, a bit intolerant of other races, I think."
Hartnell's deteriorating health (he suffered from arteriosclerosis, which began to affect his ability to learn his lines), as well as poor relations with a new production team on the series following the departure of Verity Lambert, ultimately led to him leaving Doctor Who in 1966.
When he departed, the producer of the show came up with a unique idea: that since the Doctor is an alien, he can transform himself physically, thereby renewing himself. William Hartnell himself suggested the new Doctor, stating that "There's only one man in England who can take over, and that's Patrick Troughton". In the fourth episode of the serial The Tenth Planet, the First Doctor regenerated into Troughton's Second Doctor.
Many of Hartnell's episodes are currently missing from the BBC archives as a result of the BBC's early 1970s purge.
Hartnell appears as a character in the Doctor Who audio drama Pier Pressure, which stars Colin Baker as the Sixth Doctor.
For the 50th anniversary of Doctor Who in 2013, the BBC broadcast An Adventure in Space and Time, a dramatisation of the events surrounding the creation of the series. David Bradley portrayed Hartnell.
Hartnell reprised the role of the Doctor in Doctor Who during the tenth anniversary story The Three Doctors (1972–73). When Hartnell's wife Heather found out about his planned involvement, she informed the crew of the show that his failing memory and weakening health prevented him from starring in the special. An agreement was made between the crew and Heather that Hartnell would only be required to sit down during the shoot and read his lines from cue cards. His appearance in this story was his final piece of work as an actor. His health had worsened during the early 1970s, and in December 1974 he was admitted to hospital permanently. In early 1975 he suffered a series of strokes brought on by cerebrovascular disease, and died in his sleep of heart failure on 23 April 1975, at the age of 67. He was cremated and his ashes are buried at the Kent and Sussex Crematorium and Cemetery.
A clip of a scene starring Hartnell from the end of the Doctor Who serial The Dalek Invasion of Earth (1964) was used as a pre-credits sequence for the 20th anniversary story The Five Doctors (1983); Richard Hurndall portrayed the First Doctor for the remainder of the story, in Hartnell's absence. Colourised footage of Hartnell in The Aztecs was meshed with new footage of actress Jenna-Louise Coleman, and with body doubles for the First Doctor and Susan, to create a new scene in 2013's "The Name of the Doctor". The following story and the 50th anniversary special of the show, "The Day of the Doctor", featured two new pieces of dialogue for Hartnell's Doctor, recorded by John Guilor, who had previously voiced the actor in a reconstruction of "Planet of Giants". Hartnell's Doctor also made a silent cameo appearance in the Series 9 episode "The Witch's Familiar" (2015) again played by a body double. David Bradley, who portrayed Hartnell in the biopic An Adventure in Space and Time, played the First Doctor in the Series 10 episode "The Doctor Falls", and will reprise the role in the 2017 Christmas special, also serving as Twelfth Doctor actor Peter Capaldi's final story.
Hartnell was married to Heather McIntyre from 9 May 1929 until his death. They had one child, a daughter, Heather Anne, and two grandchildren. His widow, Heather, died in 1984. The only published biography of him is by his granddaughter, Judith "Jessica" Carney, entitled Who's There? The Life and Career of William Hartnell. It was originally published in 1996 by Virgin Publishing, and to mark the 50th anniversary of Doctor Who. Carney, with Fantom Publishing, revised and republished the book in 2013.
Hartnell acted in numerous British films, as well as having many stage and television appearances, though he is most well known for his role in Doctor Who.