Steven William Moffat (; born 18 November 1961) is a Scottish television writer and producer, best known for his work as showrunner, writer and executive producer of British television series Doctor Who and Sherlock. Moffat's first television work was the teen drama series Press Gang. His first sitcom, Joking Apart, was inspired by the breakdown of his first marriage; conversely, his later sitcom Coupling was based upon the development of his relationship with television producer Sue Vertue.

He wrote the Hartswood Films drama series Jekyll, a modern version of The Strange Case of Dr Jekyll and Mr Hyde, which aired on BBC One in June and July 2007. In an interview with The Age, James Nesbitt, who played the eponymous character, called Moffat "an eccentric, shy fellow", while commending his writing as "inventive and dark and funny". In June 2007 Moffat told The Stage that he was working on a new sitcom. Provisionally titled Adam and Eve, it concerned a boss and his personal assistant, who are long-term friends but never get together. In October 2007 it was reported that Moffat would be scripting a trilogy of The Adventures of Tintin: The Secret of the Unicorn films for directors Steven Spielberg and Peter Jackson. According to The Times newspaper, Moffat had to be "love bombed" by Spielberg into accepting the offer to write the films, with the director promising to shield him from studio interference with his writing. He had intended to complete work on the whole trilogy before resuming work on Doctor Who, but the intervening WGA strike meant he could submit a finished script for the first film only. Moffat says that Spielberg was "lovely" about his decision to return to Doctor Who instead of working on the second Tintin film. The script was completed by Edgar Wright and Joe Cornish, with a part of Moffat's script used in the film. Moffat remains a writer for Hartswood Films even after his appointment as show-runner for Doctor Who. During their journeys from London to Cardiff for Doctor Who, Moffat and Mark Gatiss conceived a contemporary update of Sherlock Holmes, called Sherlock. Benedict Cumberbatch was cast as Holmes, with Martin Freeman as Dr Watson. A 60-minute pilot, written by Moffat, was filmed in January 2009. The pilot was not broadcast, but three 90-minute episodes were commissioned. Moffat wrote the first of these, "A Study in Pink", which was broadcast on 25 July 2010 on BBC One and BBC HD. A second series was broadcast in January 2012, for which Moffat wrote the episode "A Scandal in Belgravia", with a third following in January 2014. Moffat co-wrote the ninety-minute special "The Abominable Bride" with Gatiss, which aired on 1 January 2016. He also contributed to the fourth series, which was broadcast in January 2017.

When did he start working on Sherlock?
A 60-minute pilot, written by Moffat, was filmed in January 2009.