A novel in-fiber Mach-Zehnder interferometer based on cascaded up-down-taper (UDT) structure is proposed by sandwiching a piece of polarization maintaining fiber between two single-mode fibers (SMF) and by utilizing over-fusion splicing method. The dual up tapers respectively act as fiber splitter/combiner, the down taper acts as an optical attenuator. The structure parameters are analyzed and optimized. A larger interference fringe extinction ratio ~15 dB is obtained to achieve refractive index (RI) sensing based on intensity demodulation. The experimental results show that the RI sensitivity is &minus / 310.40 dB/RIU with the linearity is improved to 0.99 in the range of 1.3164&ndash / 1.3444. The corresponding resolution can reach 3.22 × / 10&minus / 5 RIU, which is 6.8 times higher than wavelength demodulation. The cross sensitivity which caused by temperature fluctuation is less than 1.4 × / 10&minus / 4.