Commonly used humidity sensors are based on metal oxides, polymers or carbon. Their sensing accuracy often deteriorates with time, especially when exposed to higher temperatures or very high humidity. An alternative solution based on the utilization of Portland cement-based mortars containing in-situ grown carbon nanofibers (CNFs) was evaluated in this study. The relationship between the electrical resistivity, CNF content and humidity were determined. The highest sensitivity was observed for samples containing 10 wt.% of the nanomodified cement which corresponded to 0.27 wt.% of CNFs. The highest calculated sensitivity was approximately 0.01024 per 1% change in relative humidity (RH). The measured electrical resistivity is a linear function of the RH in the humidity range between 11 and 97%. The percolation threshold value was estimated to be at around 7 wt.% of the nanomodified cement, corresponding to ~ 0.19 wt.% of CNFs.