A gate driver for driving a switching element includes turn-on current sources, turn-on switches, turn-off current sources, and turn-off switches. The turn-on current sources switch a voltage gradient of a rising edge waveform of a gate voltage of the switching element between a plurality of levels when the switching element is turned on. The turn-on switches drive and control the turn-on current sources. The turn-off current sources switch a voltage gradient of a falling edge waveform of the gate voltage between a plurality of levels when the switching element is turned off. The turn-off switches drive and control the turn-off current sources.