The invention relates to an ultra-high performance cement-based composite material for a sensor, the sensor and a preparation method thereof, and belongs to the technical field of civil engineering materials, and the ultra-high performance cement-based composite material comprises cement, fly ash, quartz sand, fibers, a water reducing agent, starch gel, water, carbon nanotubes, graphite powder anda surfactant. The tensile strain of the ultra-high-performance cement-based composite material is 3% or above; the defects of brittleness, low tensile strength, poor toughness, easiness in cracking and the like of a common cement-based material are overcome; the strain monitoring range of the manufactured sensor is far larger than that of a sensor made of a common smart cement-based material; thecarbon nano tube and the graphite powder are used as conductive phase materials, the manufacturing cost is low, the sensor is good in compatibility with a concrete structure, excellent in conductivity and smart, stable and reliable in performance, long in service life and easy to manufacture, and due to the addition of the starch gel, shrinkage deformation of the composite material is greatly reduced.