Slavec (Hungarian: Szalóc) is a village and municipality in the Rožňava District in the Košice Region of middle-eastern Slovakia.
In historical records the village was first mentioned in 1320. Before the establishment of independent Czechoslovakia in 1918, Slavec was part of Gömör and Kishont County within the Kingdom of Hungary. From 1938 to 1945, it was again part of Hungary as a result of the First Vienna Award.
The village lies at an altitude of 232 metres and covers an area of 17.527 km².It has a population of about 475 people.
The village has a public library.