The invention relates to NxMy high-entropy alloy with a shape memory effect and a preparing method thereof. The alloy comprises NxMy, wherein x is larger than or equal to 45 and smaller than or equal to 55, y is larger than or equal to 45 and smaller than or equal to 55, the N is any two or more of Ti, Zr, Hf, V, Nb, Ta, Mo and W and the M is any two or more of V, Mn, Fe, Co, Ni, Cu, Cr and Zn; and the content of the Ti, the content of the Zr, the content of the Hf, the content of the V, the content of the Nb, the content of the Ta and the content of the Mo in the N are each larger than or equal to 5% and smaller than or equal to 35%, and the content of the V, the content of the Mn, the content of the Fe, the content of the Co, the content of the Ni, the content of the Cu, the content of the Cr and the content of the Zn are each larger than or equal to 5% and smaller than or equal to 35%. A body-centered cubic single-phase solid solution with the volume fraction not lower than 95% and an intermetallic compound form the alloy phase structure. The alloy is prepared through an electric arc melting method. The alloy has the shape memory effect within a wider temperature range and meanwhile has the high-entropy alloy feature. The NxMy high-entropy alloy and the preparing method have wide application prospects in the fields of aerospace, mechanical electronic products and low-temperature industries.