Kostenets (Bulgarian: Костенец) is a village in the Sofia Province southwestern Bulgaria, located in the Kostenets Municipality (which also has a separate town of Kostenets). As of the 2024 census, the village had a total population of 3,138. It ranks 18th by population of all Bulgarian villages.