The invention provides application of a carbamate compound in a magnesium alloy etching additive. The carbamate compound achieves the effects of uniform corrosion inhibition and reducing of lateral corrosion on the magnesium alloy etching additive. The carbamate compound mainly comprises carbamate, 1,6-hexamethylenedicarbamate, isophorone dicarbamate, phenyl carbamate, toluene dicarbamate, 1,2-hexamethylene dicarbamate, 1,4-hexamethylene dicarbamate, and 4,4-diphenylmethane dicarbamate. The carbamate compound is matched with a corresponding surfactant, a defoaming agent, a solvent, deionized water and the like to form the additive for magnesium alloy etching, and the compound has the advantages that the use amount is small, and an etching process window is wide; meanwhile, the compound contains amino groups and ester groups, the composition of the additive is greatly simplified, the service life of the additive is prolonged, and the compound has obvious social and economic benefits.