We report an experimental demonstration of an ultracompact biochemical sensor based on a two-dimensional photonic crystal microcavity. The microcavity, fabricated on a silicon-on-insulator substrate, is designed to have a resonant wavelength (lambda) near 1.5 microm. The transmission spectrum of the sensor is measured with different ambient refractive indices ranging from n = 1.0 to n = 1.5. From observation of the shift in resonant wavelength, a change in ambient refractive index of delta(n) = 0.002 is readily apparent. The correspondence between absolute refractive index and resonant wavelength agrees with numerical calculation to within 4% accuracy. The evaporation of water in a 5% glycerol mixture is also used to demonstrate the capability for in situ time-resolved sensing.