We propose and demonstrate nonreturn-to-zero (NRZ) to pseudoreturn-to-zero (PRZ) data format conversion at 10 Gb/s based on transverse-magnetic (TM) mode absorption and self-phase modulation (SPM) in a Fabry-Perot laser diode (FP-LD). An FP-LD has absorption nulls for TM mode injected beam and the beam having NRZ data experiences SPM, which induces a frequency chirp at every rising edge and failing edge. By extracting the chirp components, all-optical NRZ-to-PRZ format conversion has been achieved. The resultant PRZ data gives well-defined 10-Gb/s clock signal. This method will be very useful in all-optical clock recovery of high-speed optical communication systems.