The invention discloses a tuberculosis gene vaccine based on T cell epitopes, wherein a full-length gene, embedded with four T cell epitope polypeptide genes which come from mycobacterium tuberculosis antigen, of mycobacterium tuberculosis heat shock protein is inserted into a vector. The invention also discloses a method for preparing the vaccine, which comprises the following steps: four T cell epitope genes, namely EAST-6189-228, Ag85A369-405, CFP10162-207 and Ag85B420-459 which come from the mycobacterium tuberculosis antigen are inserted into an HSP65 full-length gene. The invention also discloses application of an ECANS tuberculosis gene vaccine. Through the intramuscular injection of the gene vaccine into an immune mouse, the experiment proves that the vaccine can induce a specific antibody which aims at a plurality of tuberculosis antigens to response, can induce stronger tuberculosis specific killing response, can induce Th1 immune response at the same time, secrete high-level IFN gamma, and is a good vaccine for preventing and treating tuberculosis.