Abstract This paper, for the first time to the best of our knowledge, presents a novel fiber-optic refractive-index sensor which is based on an intrinsic Fabry-Perot interferometer (IFPI) formed by a section of endlessly single-mode photonic crystal fiber (EPCF) and conventional single-mode fiber. Such an IFPI sensor has the advantages of easy fabrication, low joint and transmission losses, low-cost and good fringe visibility due to the use of the EPCF. This miniature fiber-optic sensor is demonstrated for the measurement of the refractive index change of glycerin solution by measuring its fringe visibility change solely. The experimental data agree well with the theoretical results and the refractive-index resolution and repeatability of ∼2 × 10 −5 and ±0.5%FS in the linear operating range, are achieved. In addition, such a sensor can be used as an excellent temperature sensor with a cavity-length-temperature sensitivity of 4.16 nm/°C and repeatability of ±0.15%FS when tested from 20 °C to 100 °C. Therefore, simultaneous measurement of refractive index and temperature can be realized by determination of the fringe visibility and the cavity length change of such a PCF-based IFPI, respectively, providing a practical way to measure refractive index with self-temperature compensation.