Optical waveguides can be formed in potassium titanyl phosphate (KTiOPO4, KTP) crystals by an ion-exchange process. Waveguides were fabricated in KTP substrates by exchanging rubidium ions for potassium ions. The resulting refractive index profile was measured as a function of diffusion time and temperature. Based on these characterization measurements, the phase-matching properties of the planar waveguide for guided-wave second-harmonic generation were modeled. Second-harmonic generation of blue/green light was observed at wavelengths shorter than the bulk phase-matching limit, in good agreement with the results of numerical modeling.