A flexible MATLAB tool for optimal fractional-order PID controller design subject to specifications. In this paper, we present a flexible optimization tool suitable for fractional-order PID controller design with respect to given design specifications. Fractional-order controllers are based on the rapidly evolving scientific field called fractional-order calculus. Its concepts are applicable in solving many scientific and engineering problems, including robust control system design. The fractional PID is a natural evolution of the conventional PID controller and as such new tuning strategies are now possible due to enhanced accuracy of the fractional-order models. The presented tool, which is a part of FOMCON - a MATLAB fractional-order calculus oriented toolbox, - uses numerical optimization methods to carry out the tuning and obtain a controller for a chosen plant to be controlled, which can either be a fractional-order plant or an integer-order plant.