This paper aimed to study the electrical and mechanical performances of carbon nanofibers (CNFs) mortar. In this research, quartz sand was used as aggregate. The dosage of CNFs ranged from 0 to 2.4% by volume of cement, and water–cement (w/c) ratio in this study was 0.35. Electrical resistance of CNFs mortar was tested with curing time from 1 to 28 days. In addition, the flexural strength, the compressive strength and the piezoresistivity of CNFs mortar with monotonic compressive loading and cyclic compressive loading after curing for 28 days were determined. Results indicated that CNFs volume (V) of 0.3–1.8% was the percolation zone of CNFs mortar with quartz sand. When CNFs volume was in the percolation zone, the resistance decreased obviously; meanwhile, the resistivity of CNFs mortar was in a linear function of V−1/3. Moreover, the resistance of CNFs mortar with CNFs dosages of 0–1.8% tended to increase with curing time. While, as CNFs content ranged from 1.8 to 2.4%, the resistance had little change with curing time. When CNFs contents were 0.6% and 1.2%, respectively, the samples performed the optimal mechanical strengths and piezoresistive property. CNFs mortar with quartz sand presented more sensitive than CNFs mortar with river sand under monotonic compressive loading and cyclic compressive loading.