In the present study, the effect of the Nb element on the lattice parameters, phase stability and martensitic transformation behaviors of Ti-Zr-based shape memory alloys was extensively investigated using the first-principles calculation. The lattice parameters of both the β parent phase and α′ martensite phase gradually decreased with Nb content increasing. For the α″ martensite phase, the lattice constant (a) gradually increased with the increase in Nb content, whereas the lattice constants (b and c) continuously decreased due to the addition of Nb. Based on the formation energy and density of state, β→α′ martensitic transformation occurred, as the Nb content was not more than 12.5 at.%. However, the Ti-Zr-Nb shape memory alloys with a Nb content higher than 12.5 at.% possessed the β→α″ martensitic transformation. However, both the largest transformation strain and sensitivity of critical stress to temperature (dσ/dT) can be optimized by controlling 12.5 at.% Nb in the Ti-Zr-Nb shape memory alloy, which was favorable to obtaining the largest elastocaloric effect.