The aim of this paper is to employ fractional order proportional integral derivative ( FO-PID ) controller and integer order PID controller to control the position of the levitated object in a magnetic levitation system ( MLS ), which is inherently nonlinear and unstable system. The proposal is to deploy discrete optimal pole-zero approximation method for realization of digital fractional order controller. An approach of phase shaping by slope cancellation of asymptotic phase plots for zeros and poles within given bandwidth is explored. The controller parameters are tuned using dynamic particle swarm optimization ( dPSO ) technique. Effectiveness of the proposed control scheme is verified by simulation and experimental results. The performance of realized digital FO-PID controller has been compared with that of the integer order PID controllers. It is observed that effort required in fractional order control is smaller as compared with its integer counterpart for obtaining the same system performance.