The invention relates to a heavy metal stabilizer used for sludge treatment. The stabilizer comprises, by weight, 30-90 parts of inorganic powder, 0.1-20 parts of sulfide, 0.1-20 parts of organic chelate, 0.1-20 parts of an amide chemical substance, and 0.1-20 parts of an organic flocculating agent. The stabilizer is used for treating sludge, especially low-content sludge or sludge containing a plurality of heavy metals, the content of heavy metals in a leachate of heavy metals in the sludge immobilized and stabilized by the heavy metal stabilizer is far lower than Chinese standards, the stabilized sludge can be locally embedded or applied to roadbeds, greening, soil covering, ecologic restoration and the like, and the stablizer can effectively solve the problem of difficult treatment of the heavy metal sludge, causes no secondary pollution to the environment, can realize an efficient, reasonable, environmentally-friendly and economic treatment technology, and can be widely applied to sludge treatment. The stabilizer has the characteristics of cheap and easily available raw materials, simple technology and apparatus, small investment, easy operation and the like, and has a high economic benefit. The invention also provides a method for treating sludge by adopting the heavy metal stabilizer.