A pilot-based nonlinearity compensator (PB-NLC) is shown in this Letter to be an effective method for compensating cross-phase modulation (XPM) in coherent optical orthogonal frequency division multiplexing (CO-OFDM) systems. An unmodulated pilot tone is transmitted at the center of each OFDM channel to detect phase errors caused by the Kerr effect, which converts intensity fluctuations from all channels to phase errors. The pilots are then used to cancel the XPM phase errors for each OFDM channel at the receiver after each channel’s self-phase modulation (SPM) has been compensated, using its intensity waveform to determine its SPM. Numerical simulations of a 58 Gb/s single polarization 2375 km system with inline dispersion compensation show that the signal quality, Q, at the optimal launch power is increased by 2.4 dB if SPM compensation is used before the PB-NLC. This contrasts with only a 0.9 dB improvement if the PB-NLC is used without an SPM compensator for the same link. This shows the PB-NLC can effectively mitigate XPM but not SPM.