A switching power supply of the present invention comprises: a switching element through which a DC voltage is supplied via a primary winding; an output voltage detection circuit detecting a voltage of a secondary winding to generate an error signal; a regulator generating a predetermined voltage based on a voltage generated at a node between the switching element and the primary winding; a photocoupler through which a feedback current signal corresponding to the error signal passes; a feedback current detection circuit detecting a feedback current signal; a feedback voltage generation circuit generating a feedback voltage according to the current of the feedback current detection circuit when the switching element is OFF and holding the generated feedback voltage when the switching element is ON; and a control circuit controlling ON/OFF duty of the switching element according to an increase or decrease of the feedback voltage.