The invention relates to a free-piston engine, which comprises a hydraulic pump body assembly, a first air cylinder, a second air cylinder, a push rod hole, a first pull rod hole, a first crossed connection passage, a first inner piston, a second inner piston, a push rod, an inner plunger, a first outer piston, a second outer piston and a first outer plunger, wherein the first air cylinder and the second air cylinder are arranged on two sides of the hydraulic pump body assembly; the first crossed connection passage is arranged between the first push rod hole and the first pull rod hole; the first inner piston is arranged in the first air cylinder; the second inner piston is arranged in the second air cylinder; two ends of the push rod are respectively fixed on the first inner piston and the second inner piston; the inner plunger is installed between the push rod and the push rod hole, an inner pump chamber and an inner coupling pump chamber are respectively formed on two ends of the push rod hole, and an inner coupling pump chamber is communicated with the first crossed connection passage; the top end of the first outer piston is close to the first inner piston; the top end of the second outer piston faces towards the second inner piston; two ends of the first pull rod are arranged on the first outer piston and the second outer piston; and the first outer plunger is arranged between a first pull rod and the first pull rod hole, the first outer plunger forms a first outer pump chamber and a first outer coupling pump chamber with two ends of the first pull rod hole, and the first outer coupling pump chamber is communicated with the first crossed passage.