The invention discloses a medicine for treating urinary tract infection and a preparation method thereof, and belongs to the field of traditional Chinese medicines. Effective components of the medicine comprise the following raw materials: leaf of Chinese toona, common cephalanoplos herb, ammannia auriculata, leaf of shrubby baeckea, ludwigia prostrate, manyinflorescaned sweetvetch root, root of toothed habenaria, fruit of greywhitehair raspberry, herb of umbellate hawkweed, herb of clavateleaf oberonia, herb of smallflower beggarticks, clematoclethra argentifolia, bottle brush herb, root of Chinese clovershrub, root of wintersweet and stem of moupin dutchmanspipe. Medicinal materials adopted by the medicine disclosed by the invention have appropriate compatibility and can complement each other, so that the medicine has the effects of clearing heat and diminishing swelling, inducing diuresis and treating stranguria, nourishing the kidneys and invigorating the lung, eliminating dampness and removing toxicity, dispelling wind and relieving pain, and regulating qi and activating blood; various medicines can be combined to directly reach lesion sites so as to ensure that the medicine has the advantages of quick action, high cure rate, no toxic or side effects, safety and convenience in treating symptoms such as seminal vesicle enlargement, body pain, high blood pressure, repeatedly-unhealed infections, urine ammonia smell, seminal vesicle shrinkage, low sperm viability, painless scrotal mass and low sperm survival rate caused by urinary tract infection; and moreover, the medicine is cheap in price and easy to prepare, and can be widely applied to clinical treatment of urinary tract infection.