Sir John Dalrymple of Cousland, 4th Baronet FRSE FSA(Scot) (1726 – 26 February 1810) was a Scottish advocate, judge, chemist and author. He is best known for his Memoirs of Great Britain and Ireland from the dissolution of the last parliament of Charles II until the sea battle of La Hogue, first published in 1771. A new edition of 1790 carried on to the capture of the French and Spanish navies at Vigo.
In later life he was known as John Hamilton Macgill Dalrymple (not to be confused with John Hamilton Dalrymple, 8th Earl of Stair. The Dalrymple family formed a long and large dynasty amongst the legal profession in Scotland. He was one of the central figures of the Scottish Enlightenment and was a friend of persons such as David Hume and Adam Smith. However, his literary works were frowned upon and he has been described as an irritating member of the Edinburgh literati.
He was the son of Sir William Dalrymple of Cranstoun, 3rd Baronet (1704–1771) a cousin of William Dalrymple-Crichton, 4th Earl of Stair. His mother was Agnes Crawford (d.1755).
He was educated at Edinburgh and Cambridge universities, Dalrymple was admitted to the Faculty of Advocates in 1748. He served as Solicitor to the Board of Excise, and as a Baron of the Exchequer (1776–1807).
On Thomas Hamilton's death in 1779, Sir John inherited Oxenfoord, and began laying out the gardens. He published his Essays on Different Natural Situations of Gardens in 1774, which became an influential book at the time.
In 1783 he was a co-founder of the Royal Society of Edinburgh.
In later life his Edinburgh townhouse was at 15 Buccleuch Place just south of George Square.
He died on 26 February 1810.