A photocoupler having a first and second light-emitting diodes, a compensation circuit, which compensates input signals to the first light-emitting diode and generates input signals to the second light-emitting diode, and further makes the current waveform at the second light-emitting diode complementary to the current waveform at the first light-emitting diode, and at least one photodiode that detects the light emitted from the first and second light-emitting diodes.