James Peter Hymers Mackay, Baron Mackay of Clashfern, KT, PC, FRSE (born 2 July 1927) is a British lawyer. He served as Dean of the Faculty of Advocates, Lord Advocate, and Lord Chancellor (1987–1997). He is a former active member of the House of Lords, where he sat as a Conservative. He retired from the House on 22 July 2022.
 Mackay was born in Edinburgh on 2 July 1927. He won a scholarship to George Heriot's School, and then studied mathematics and physics at the University of Edinburgh, receiving a joint MA in 1948. He taught mathematics for two years at the University of St Andrews before moving to Trinity College, Cambridge, on a scholarship, from which he obtained a BA in mathematics in 1952. He then returned to Edinburgh University where he studied law, receiving an LLB (with distinction) in 1955.
 Mackay was elected to the Faculty of Advocates in 1955.  He was appointed a Queen's Counsel in 1965. He was Sheriff Principal for Renfrew and Argyll from 1972 to 1974. In 1973 he became Vice-Dean of the Faculty on Advocates and from 1976 until 1979 served as its Dean, the leader of the Scots bar.
 In 1979, Mackay was appointed Lord Advocate, the senior law officer in Scotland, and was created a life peer as Baron Mackay of Clashfern, of Eddrachillis in the District of Sutherland, taking his territorial designation from his father's birthplace, a cottage beside Loch na Claise Fearna. Since his retirement, Mackay sat in the House of Lords. He was also Commissary to the University of Cambridge until 2016. He is the editor-in-chief of Halsbury's Laws of England, the major legal work which states the law of England, first published in 1907; the post is usually held by a former Lord Chancellor. He is also a senior fellow of The Trinity Forum, a Christian nonprofit that supports the renewal of society through the development of leaders.
 Mackay is the son of railway signalman James Mackay (who came from Claisfearn near Tarbet in Sutherland) and his wife Janet Hymers. Mackay married Elizabeth Gunn Hymers, of Halkirk, in 1958. They have a son, James and two daughters, Elizabeth and Shona. Mackay was raised a member of the Free Presbyterian Church of Scotland; as an adult he was an elder of the church. The church forbids its members to attend Catholic religious services; nevertheless Mackay attended two Catholic funeral masses for members of the judiciary (for Charles Ritchie Russell in 1986, and again for John Wheatley in 1988). Following the second mass Mackay was called before a church synod where he denied that he had broken the church's prohibition of showing "support for the doctrine of Catholicism", saying "I went there purely with the purpose of paying my respects to my dead colleagues." The church suspended Mackay from the eldership and from membership. The synod met again in Glasgow in 1989 to review the decision; the meeting asked Mackay to undertake not to attend further Catholic services, but he announced "I have no intention of giving any such undertaking as that for which the synod has asked", and later withdrew from the church. The dispute precipitated a schism, leading to the formation of the Associated Presbyterian Churches. Mackay did not join the new communion, but as of 1993 worshipped with their Inverness congregation.
 As a Presbyterian, Mackay was a firm believer in moderation. At a gathering for the Faculty of Advocates, Mackay had laid on a spread of tea and toast, complete with a tiny pot of honey. One of the lawyers in attendance contemplated the pot and remarked, "I see your Lordship keeps a bee." Mackay is also the Honorary President of the Scottish Bible Society. He supported the society's programme to send a Bible to every court in Scotland and wrote in support of "The Bible in Scots Law", a pamphlet it distributed to Scottish lawyers which described the Bible as a "foundational source book for Scotland's legal system". He is a strict sabbatarian, refusing to work or travel on a Sunday, or even to give an interview if there is a chance it could be rebroadcast on the sabbath.
 Mackay was appointed a Knight of the Thistle by Queen Elizabeth II on 27 November 1997. In 2007 the Queen appointed him to the office of Lord Clerk Register, replacing David Charteris, 12th Earl of Wemyss. He retired from this office in November 2022, and was succeeded by Lady Elish Angiolini. He became a fellow of the Royal Society of Edinburgh in 1984. In 1989, he was elected honorary fellow of Trinity College, Cambridge. He received an honorary doctorate from Heriot-Watt University in 1990. He was awarded an honorary degree (Doctor of Laws) by the University of Bath in 1994 and by Northumbria University in 2017.