Rajec (-Slovak and Hungarian, German: Rajetz) is a town in the Žilina District, Žilina Region in northern Slovakia.
The first written record about Rajec was in 1193 as Raich, in a document issued by King Béla III. The first mention as a town comes from 1397.
Rajec lies at an altitude of 452 metres (1,483 ft) above sea level and covers an area of 31.459 square kilometres (12.1 sq mi). It is situated between Strážovské vrchy and Malá Fatra mountains, in the Rajčanka river valley, around 20 km (12 mi) south-south-west of Žilina.
According to the 2001 census, the town had 6,074 inhabitants. 98.86% of inhabitants were Slovaks and 0.68% Czechs. The religious make-up was 92.79% Roman Catholics, 3.42% people with no religious affiliation and 1.89% Lutherans.
Rájec is a village and municipality (obec) in Šumperk District in the Olomouc Region of the Czech Republic.
The municipality covers an area of 4.91 square kilometres (1.90 sq mi), and has a population of 489 (as at 28 August 2006).
Rájec lies approximately 14 kilometres (9 mi) south-west of Šumperk, 39 km (24 mi) north-west of Olomouc, and 180 km (112 mi) east of Prague.