A flyback converter having temperature compensation, the converter being an isolated converter using primary side sensing and an output diode, the output diode having a variable voltage drop related to its temperature, the converter generating a feedback voltage (V FB) in a feedback loop, wherein the feedback voltage (V FB) corresponds to the output voltage (V OUT) of the converter, wherein the feedback voltage is compared to a fixed reference voltage (V REF) for setting a duty cycle of a power switch (M POWER) for generating a regulated output voltage (V OUT), wherein the feedback loop causes the feedback voltage (V FB) to approximately equal the reference voltage (V REF), the feedback voltage (V FB) being scaled by a scaling resistance (RP 1), the converter comprising a temperature compensation circuit for at least partially offsetting a rise in the output voltage (V OUT) with temperature due to the variable voltage drop of the diode, the temperature compensation circuit comprising: a voltage source configured to generate a proportional-to-absolute-temperature voltage (V PTAT), wherein the proportional-to-absolute-temperature voltage (V PTAT) is at approximately the reference voltage (V REF) at a calibration temperature (T 0) and rises as a temperature exceeds the calibration temperature (To); and a temperature compensation resistance (R TC) coupled between the voltage source and a feedback voltage (V FB) node of the converter while the converter is operating, wherein substantially no current flows through the temperature compensation resistance (R TC) at the calibration temperature (T 0) due to the feedback voltage (V FB) and the proportional-to-absolute-temperature voltage (V PTAT) both being at approximately the reference voltage (V REF) at the calibration temperature (T 0), and wherein the temperature compensation circuit generates a compensation current (I TC) through the temperature compensation resistance (R TC) at temperatures above the calibration temperature (T 0) to lower a duty cycle of the power switch and, therefore, lower the output voltage (V OUT) at temperatures above the calibration temperature (T 0) to at least partially offset the rise in the output voltage (V OUT) with temperature. a voltage source configured to generate a proportional-to-absolute-temperature voltage (V PTAT), wherein the proportional-to-absolute-temperature voltage (V PTAT) is at approximately the reference voltage (V REF) at a calibration temperature (T 0) and rises as a temperature exceeds the calibration temperature (To); and a temperature compensation resistance (R TC) coupled between the voltage source and a feedback voltage (V FB) node of the converter while the converter is operating, wherein substantially no current flows through the temperature compensation resistance (R TC) at the calibration temperature (T 0) due to the feedback voltage (V FB) and the proportional-to-absolute-temperature voltage (V PTAT) both being at approximately the reference voltage (V REF) at the calibration temperature (T 0), and wherein the temperature compensation circuit generates a compensation current (I TC) through the temperature compensation resistance (R TC) at temperatures above the calibration temperature (T 0) to lower a duty cycle of the power switch and, therefore, lower the output voltage (V OUT) at temperatures above the calibration temperature (T 0) to at least partially offset the rise in the output voltage (V OUT) with temperature.