Chemical heterogeneity is usually avoided in solution chemistry, but it may still occur with sometimes dramatic effects on target materials and their properties. Here, we propose chemical heterogeneity as a counterintuitive strategy to design high-performance zero thermal expansion (ZTE) alloys. We apply this approach in a Hf-Ti-Fe alloy with excess Fe in the Hf/Ti sublattice and produce Hf/Ti concentration alternations at the micro level. Such chemical heterogeneity regulates local magnetic interactions in alloy and triggers a dispersed magnetic phase transition that modulates the thermal expansions at the micro level and hence results in a remarkable ZTE behavior over a super-wide temperature window from 10 to 480 K. This mechanism is supported by comprehensive studies on morphological microstructures, crystal and magnetic structures, and theoretical calculations. The strategy of local chemical heterogeneity opens up an avenue to design ZTE and the related functional materials directly via microstructure engineering.