Moffat was educated at the University of St Andrews, graduating in 1972 with a degree in Medieval History. While at St Andrews Moffat earned first team caps in both rugby and cricket, also playing basketball and athletics.
Moffat was also active in student politics throughout his time at St Andrews, playing a leading role in the rectorial campaign of John Cleese, who went on to become one of St Andrews' best loved rectors.
After graduating from St Andrews in 1972, Moffat went on to earn degrees from the University of Edinburgh and the (then) University of London (MPhil). While at Edinburgh Moffat continued his involvement in student politics, campaigning with Gordon Brown, the second student elected rector of the University of Edinburgh. Moffat and Brown went on to campaign on a number of social and political issues including gay rights and the 1979 Edinburgh South by-election.
Moffat found early success after university, becoming Director of the Edinburgh Festival Fringe in 1976. Moffat's five-year tenure saw the festival grow into the largest arts festival on the world.
Moffat left the Fringe in 1981 and joined STV, where he rose to become programme director, Chief Executive of Network Production and finally Chairman of STV. While at STV Moffat won a number of awards for his work, notably several Royal Television Society awards and a BAFTA for his documentary on the Lockerbie Bombing. In 1989 he was appointed to the NSG, the group that controls UK wide scheduling for ITV, commanding a budget of £750 million. He left STV in 1999 to focus on writing.
During the 1970s and early 1980s Moffat wrote a number of papers focusing on education policy. His approach, recommending a renewed focus on primary education as the key to widening participation at secondary and higher levels, has since formed parts of the education manifestos of all three major parties in Britain.
Moffat's writing since 1999 has been focused mainly in the field of social history. Beginning with The Edinburgh Fringe (1978), he has written over twenty books including the bestselling Tyneside, The Reivers and The Wall, all of which have since been remade as television series.
Since leaving STV in 1999, Moffat has served as Director of the Borders Book Festival and Lennoxlove Book Festival, both of which he also founded. He has also maintained his interest in education, serving as Director of "Book Nation", a Scottish national literacy initiative, working alongside Sir Robert Winston and Margaret Drabble to improve literacy in Scotland.
On 28 October 2011, Moffat was elected Rector of the University of St Andrews. He was appointed for a three-year term, his period of office spanning the university’s 600th anniversary celebrations which ran from 2011 to 2013.
Moffat was the chief executive of the company BritainsDNA, which offered genetic analyses of the mitochondrial DNA and Y chromosomal DNA of customers who interested in their ancestry. On the BBC Today Programme, Moffat made numerous inaccurate statements, including that the company has discovered Eve's "grandson", that prices were "heavily subsidised", and that 97% of men surnamed Cohen share a common genetic marker. These statements were later retracted by the chief scientist of BritainsDNA. In the meantime, two geneticists at University College London, David Balding and Mark G. Thomas, as well as other UCL colleagues, have attacked both these statements and genetic ancestry companies in general. Thomas in particular has suggested that the entire field of interpretive phylogeography, on which much of such genetic testing is based, has no scientific basis and is little more than genetic astrology. However, Martin Richards, professor of archaeogenetics at University of Huddersfield, and Vincent Macaulay, reader in statistics at the University of Glasgow, have contested these claims.
Sometime after the interview on the Today Programme, Balding and Thomas wrote a series of emails to Moffat and his business partners. The content of messages has never been published and is disputed between the various parties. However, it is known that Moffat wrote to the Provost of UCL to attempt to get Thomas and Balding to retract comments made in these communications and that Moffat issued a threat to sue if they were repeated. Balding and Thomas alleged that these threats were made to silence their criticism of the underlying science. Moffat and his business partners claim that Thomas and Balding made a series of highly defamatory comments and never impinged on their academic freedom.
Britain's DNA is one of a group of commercial companies providing DNA ancestry testing, set up by Moffat in 2012 and 2013; Scotland's DNA (the first), Ireland's DNA and Yorkshire's DNA.
Moffat was co-chairman and historian for the Great Tapestry of Scotland, a community arts project which produced the embroidered tapestry, designed by Andrew Crummy with contributions from around 1000 stitchers from across Scotland. It was unveiled on 3 September 2013 at the Scottish Parliament.
Moffat met his wife Lindsay while both were students at the University of St Andrews. They were married in 1976 in the university's ancient St Salvator's Chapel, a privilege and tradition commonly reserved only for alumni, staff or their offspring. The couple have three children, two of whom also attended St Andrews.
From 2009 to 2011 he served at the invitation of James Naughtie, the Chancellor of the University of Stirling, as Chancellor's Assessor on Stirling's University Court. He resigned the position in October 2011 on being invited to run for Rector of the University of St Andrews, an election which he won on 28 Oct 2011.
He remains a passionate rugby supporter and regular attender of his national team's games. On one occasion, he refused to buy Tony Blair tickets for the Calcutta Cup (which he was attending with Gordon Brown) because Blair suggested he would support England rather than his native Scotland.