A magnetic actuator. The magnetic actuator comprises a first magnet, a second magnet, a first yoke, and a first coil. The second magnet is arranged axially with respect to the first magnet with repulsion therebetween. The first yoke is disposed between the first magnet and the second magnet, and the magnetic field lines produced by the first magnet and the second magnet extend from the first yoke. The first coil surrounds and corresponds to the first yoke. When a current is occurred in the first coil, the magnetic force generated between the first magnet and the second magnet will actuates the first coil to move axially with respect to the first and second magnets.