an optical transmitting device that compensates for waveform distortion in an optical signal path .. the device has an amplifier for amplifying an optical signal input through an optical transmission line . a plurality of dispersion compensators are used to compensate for various degrees of waveform distortion due to dispersion distortion in the optical transmission line by having different dispersion compensating characteristics . a selection switch selects one of the dispersion compensators and connects the first amplifier output with the selected dispersion compensator . another amplifier is used to amplify the optical signal output by the selected dispersion compensator .