An imidazoliny corrosion inhibitor was prepared with maize oil.The corrosion rate and inhibition efficiency of carbon steel in hydrochloric acid was investigated by weight loss method,and inhibiting mechanism of the new inhibitor was inquired into.The results showed that the new imidazoliny inhibitor had strong corrosion inhibiting ability for 20A carbon steel in hydrochloric acid.