General John Hamilton Dalrymple, 8th Earl of Stair KT (14 June 1771 – 10 January 1853), known as Sir John Dalrymple, 5th Baronet, between 1810 and 1840, was a British soldier and politician.
Stair was the son of Sir John Dalrymple, 4th Baronet, and Elizabeth, daughter of Thomas Hamilton-Makgill and heiress and representative of the Viscounts of Oxfuird (or Oxenfoord). In 1810 he succeeded in the baronetcy, and inherited Oxenfoord Castle, on the death of his father.
Stair was a general in the British Army. In 1832 he was returned to Parliament for Midlothian, as seat he held until 1835. He succeeded a distant relative as eighth Earl of Stair in 1840. As this was a Scottish peerage it did not entitle him to an automatic seat in the House of Lords. However, in 1841 he was created Baron Oxenfoord, of Cousland in the County of Edinburgh, in the Peerage of the United Kingdom, which gave him a seat in the upper chamber of parliament. The peerage was created with special remainder to his younger brother. The choice of title was in honour of the title held by his mother's family, Viscount of Oxfuird of Oxenfoord. In 1847 he was further honoured when he was appointed a Knight of the Thistle.
Lord Stair was twice married. He married firstly Harriet, daughter of Reverend Robert Augustus Johnson, in 1795. After her death in 1823 he married secondly the Hon. Adamina, daughter of Admiral Adam Duncan, 1st Viscount Duncan, in 1825. Both marriages were childless. Lord Stair died in January 1853, aged 81, and was succeeded in his titles (in the barony of Oxenfoord according to the special remainder) by his younger brother, North. The Countess of Stair died in August 1857.