The invention discloses a niacinamide ribose phosphate transferase for preparing NMN, a coding gene, a recombinant vector and application and belongs to the technical field of biology. The transferaseis protein of which the amino acid sequence is shown in pSEQ ID No.1 or pSEQ ID No.2 or pSEQ ID No.3 or pSEQ ID No4. The gene for coding the protein is cloned to an expression vector of escherichia coli, and a recombinant plasmid is established; then, the recombinant plasmid is converted into escherichia coli competent cells, a positive clone is selected, an expression strain of recombinant escherichia coli is obtained, and then liquid fermentation is conducted; in the fermentation process, the generated recombinant niacinamide ribose phosphate transferase is generated, and after a substrateis added, beta-nicotinamide mononucleotide can be generated. According to the transferase, NMN is conveniently and efficiently prepared, the fermentation technology is simple, the consumed time is short, the cost is low, the cost of obtaining NMN is 0.25-1.0 yuan/mg, compared with a traditional method, the cost can be lowered by above 90%, the yield reaches 51.75 mg/g of protein, and the economicbenefit is obvious.