An inductor includes a bobbin, a first winding, a second winding, a core set and a magnetic element. The first and second windings are respectively wound around the bobbin and separated by a partition, which is formed on the bobbin and has a recess for accommodating the magnetic element. The core set has one portion passing through the bobbin and the other portion surrounding the bobbin, the first winding and the second winding. The magnetic element is connected with the one portion of the core set passing through the bobbin and is apart from the other portion of the core set outside the bobbin by a gap.