This paper presents a comparative spectral analysis for tuning all-fiber directional coupler-based Mach–Zehnder Interferometer (MZI) and all-fiber inline Micro Mach–Zehnder Interferometer (MMZI) configurations. The analytical background is necessary to estimate the change in the differential path length for tuning the channel (peak) wavelengths and inter-channel spacing (i.e. free spectral range) of the MZI. We briefly describe the method used to adjust the spectral response experimentally. The spectral tuning of all-fiber MZI and MMZI has been successfully implemented in different applications of fiber optic communication and sensing (Ramachandran et al (2014 IEEE Sens. J. 15 1270–4; 2017 Opt. Fiber Technol. 36 195–8), Kumar and Ramachandran (2013 Opt. Commun. 289 92–96; 2014 Opt. Laser Technol. 63 144–7)). The spectral tuning of the MMZI is based on the interference length. Compared to MZI, miniaturized MMZI does not deal with any spectral fluctuation when employed in dense wavelength division multiplexing (DWDM) application and a sensing scheme. Research during the past year has surveyed the different MZI structures from an application perspective to infer that MMZI might be the most suitable configuration for sensing applications, and MZI may prove to be more useful in DWDM optical networks.