An optical transmitter includes: a controller that generates a multi-level amplitude modulated signal based on transmission data that is binary data; a driver that generates a drive signal in accordance with the multi-level amplitude modulated signal; and a light emitter that generates an optical signal in accordance with the drive signal. The controller selects one of a first encoding method and a second encoding method in accordance with a switching signal. The controller generates the multi-level amplitude modulated signal by converting a bit string of M (M is an integer of 2 or more) bits included in the transmission data into a pulse signal having 2