The invention discloses an environment-friendly and energy-saving hydraulic oil. The hydraulic oil comprises, by weight, 60 to 80 parts of a binding agent, 60-90 parts of medium oil, 0.1-0.5 part of an anti-aging agent, 0.1-0.5 part of a rust loosening agent, 0.1-0.5 part of a pour point depressant, 0.8-3 parts of a defoaming agent, 50-80 parts of a heat stabilizer, 50-80 parts of an expanding agent, 40-70 parts of a thickening agent, 50-90 parts of a vulcanizing agent, 0.1-0.9 part of an extreme pressure anti-wear agent and 0.8-3 parts of an activator. The invention also discloses a preparation method of the environment-friendly and energy-saving hydraulic oil. By utilizing the excellent thermal oxidation stability of an ionic liquid, the proper viscosity index is adjusted, the dissolvingcapacity is changed, and the anti-wear and anti-friction effects are good, and the energy-saving and environment-friendly hydraulic oil is prepared; and the ionic liquid with excellent thermal oxidation stability, high viscosity index, good dissolving capacity for inorganic salt and organic matter and good anti-wear and anti-friction effects is synthesized, the ionic liquid is used as a base liquid, and an additive with an excellent extreme pressure anti-wear effect is added to prepare the green, environment-friendly and energy-saving hydraulic oil.