The invention discloses a technique for preparing antimicrobial peptide by using Bacillus subtilis, belonging to the technical field of bioengineering. By using Bacillus subtilis BRT39 capable of generating broad-spectrum high-efficiency antimicrobial peptide as a production strain, liquid seed preparation, fermentation liquid preparation, fermentation liquid pretreatment, antimicrobial peptide extraction and refinement, antimicrobial peptide dry powder preparation and other techniques are carried out to prepare the high-purity antimicrobial peptide finished product, wherein the activity recovery rate is up to higher than 43.5%. The invention has the advantages of simple technique, high yield of antimicrobial peptide, and high purity; the prepared antimicrobial peptide dry powder belongs to a natural antimicrobial agent and has no toxic or side effect, and thus, can be used as a food preservative, feed additive, agricultural biological control agent or animal disease preventing agent; and the antimicrobial peptide has the advantages of no toxicity, no residue, no drug resistance and high safety.