The invention provides a foaming agent specially used for a soil pressure balance shield tunneling machine and a preparation method thereof, and relates to the field of shield construction buildings. The foaming agent is prepared from the following raw materials, in parts by weight: 6-10 parts of sodium dodecyl sulfate, 9-15 parts of dodecyl betaine, 3-5 parts of sodium chloride, 6-8 parts of n-butyl alcohol, 4-6 parts of dodecyl dimethyl amine oxide, 2-3 parts of sodium lauryl alcohol polyoxyethylene ether sulfate, 5-7 parts of sodium alginate, 3-7 parts of sodium dodecyl polyoxyethylene ether sulfate, 3-5 parts of hexadecyl trimethyl ammonium chloride, 2-3 parts of fluoranthene, 2-4 parts of ethylenediamine tetraacetic acid disodium salt, 3-5 parts of a cinnamon bark extractive, 3-5 parts of polyethylene glycol, 5-7 parts of a tackifier, and 70-100 parts of water, and the preparation method comprises three steps. According to the invention, the foaming agent can improve soil plasticity, fluidity and impermeability, can improve residual soil fluidity in seal earth cabins, protects cutting tools, reduces cutter head torque, can make soil bodies formed soil plugs in a screw conveyer, and effectively prevents spewing, and the foaming agent has no toxicity, no corrosion, good bubble stability, and long duration time.