Longformacus (Scottish Gaelic: Longphort Mhacais) is a small village in Berwickshire in the Scottish Borders area of Scotland. It is around 10 kilometres (6.2 mi) north-west of Duns, in the Lammermuir Hills. The Dye Water runs through the village, flowing east towards its confluence with the Whiteadder Water nearby. The opera Lucia di Lammermoor, written by Gaetano Donizetti and based on Sir Walter Scott's The Bride of Lammermoor, was set in Longformacus.
The Southern Upland Way, a Long Distance Route which crosses southern Scotland, passes through the village, and the Sir Walter Scott Way from Moffat to Cockburnspath passes through Longformacus.
Coordinates: 55°48′28″N 2°29′32″W / 55.80782°N 2.49212°W