The temperature dependence of a refractive index (RI) sensor based on a core-offset in-line fiber Mach-Zehnder interferometer was investigated in order to eliminate the temperature and RI cross sensitivity caused by the thermo-optic effect. The RI sensitivity of the sensor was around -20.00 nm/RIU, and the RI correction was given for the sensor in the temperature range of 25-60℃. The experimental results showed that the temperature variation might lead to deviation in the measurement of RI, but hardly affected the RI sensitivity.