A new, simple method to measure the nonlinear refraction and absorption of bulk material and waveguides is proposed. The method relies on the evolution of the intensity and width of femtosecond-pulse spectra, owing to self-phase modulation, as a function of variable chirp and stretching introduced at the input.