A transformer. The transformer comprises a bobbin, a first core and a second core. The bobbin comprises a primary winding area and a secondary winding area. The first core is disposed in the bobbin. The second core is mounted on the bobbin. The second core comprises a plurality of first protrusions which are disposed at two sides of the bobbin. A second protrusion is integrally formed on the second core and is disposed between the first protrusions. The second protrusion is disposed between the primary winding area and the secondary winding area.