Sir David Dalrymple, 3rd Baronet, Lord Hailes (October 28, 1726 – November 29, 1792) was a Scottish advocate, judge and historian, born in Edinburgh.
His father, Sir James Dalrymple, 2nd Baronet, of Hailes, Haddingtonshire, Auditor of the Exchequer in Scotland, was a grandson of James Dalrymple, 1st Viscount of Stair; and his mother, Lady Christian Hamilton, was a daughter of Thomas Hamilton, 6th Earl of Haddington. The eldest of sixteen children, he succeeded to his father's baronetcy upon his death in 1751.
He was educated at Eton, and studied law at Utrecht. In 1748 upon his return to Scotland from Utrecht he was admitted an Advocate. It is said that as a pleader he attained neither high distinction nor very extensive practice, but he rapidly established a well-deserved reputation for sound knowledge, unwearied application and strict probity, and in 1766 he was elevated to the bench in the Court of Session where he assumed the title of Lord Hailes. Ten years later he was appointed a Lord of Justiciary.
He was twice married: (1) in 1763, to Anne, daughter of Sir George Broun, Lord Coalston, a Lord of Session, by whom he had a daughter, Christian (d.1838). He remarried (2) March 20, 1770, Helen (d. 1799), daughter of Sir James Fergusson, Baronet, of Kilkerran, Ayrshire, by whom he had another daughter, Jean (d.1803) who married her cousin, James Fergusson, Esq., and left issue.