St. Margrethen is a municipality in the Wahlkreis of Rheintal in the canton of St. Gallen in Switzerland. It is located on the Swiss–Austrian border.