We experimentally demonstrate linewidth-tolerant real-time 40-Gbit/s(10-Gsymbol/s) 16-quadrature amplitude modulation. We achieved bit-error rates of <10(-9) using an external-cavity laser diode with a linewidth of 200 kHz and <10(-7) using a distributed-feedback laser diode with a linewidth of 30 MHz, thanks to the phase-noise canceling capability provided by self-homodyne detection using a pilot carrier. Pre-equalization based on digital signal processing was employed to suppress intersymbol interference caused by the limited-frequency bandwidth of electrical components.