Magnetic levitation system with its advantages of no contact, no friction, and no abrasion can easily realize high-precision and high-speed positioning. This paper, first, introduces the structure of the magnetic levitation stage. Then its dynamic model with uncertainty and external disturbance is given, from which it can be seen that magnetic levitation system is highly nonlinear and strongly coupled. So, exact feedback linearization is applied to realize linearization and decoupling in the horizontal and vertical subsystems. Sliding mode controllers with variable switching gains, which are regulated according to fuzzy logic for the two subsystems, are designed. Particle swarm optimization with adaptive inertia weight regulation is used to find the optimum value of the quantification factor and scaling factor of the fuzzy logic system for both the horizontal and vertical direction. Simulation results show that this control method can achieve good dynamic performance with no overshoot and fast response and it can also offset the uncertainty and disturbance more effectively than controllers without the corresponding compensation. Moreover, the decreasing switching gains of the sliding mode controllers are presented, which contributes to reducing the chattering.