Their success at the event in Cape Town is expected to help spark more interest in next year's maths Olympiad, which will be held in Thailand.
Pornpun Waitayangkoon, president of the Institute for the Promotion of Teaching Science and Technology (IPST), said 560 students from 101 countries participated in the contest in South Africa, which opened on July 3 and concludes on Sunday.
Four silver medals went to Kritkorn Karntikoon, 18, of Chulalongkorn University Demonstration School; Sivakorn Sanguanmoo, 16, of Mahidol Wittayanusorn School; Suchan Vivatsethachai, 17, of Trium Udom Suksa School; and Phusit Wattanawongwibul, 18, of Trium Udom Suksa School.
Bronze winners were Tanat Komolsiripakdi, 18, of Bangkok Christian College; and Thee Ngamsangrat, 17, of Trium Udom Suksa School.
Mrs Pornpun said Thailand and Iran tied for 21st place in the overall country standings. In the top five positions were China, the United States, Taiwan, Russia and Japan. China and the US led the gold-medal table with five each.
The Thai delegation will arrive at Suvarnabhumi airport at 5.55am on Tuesday. The next International Mathematical Olympiad will be held in Chiang Mai from July 3 to 15, 2015.