A symmetric one-dimensional photonic crystal configuration with defect layer is proposed for an optical gas sensor based device application. Here, Silicon and Si3N4 are considered as materials of dielectric layers with zero value of extinction coefficient in the wavelength range of concern. The transmission of PC configuration is estimated using the transfer matrix approach in case of configuration with and without defect, and the infiltrated gas is treated as defect layer. On the basis of the defect mode’s wavelength, gas can be determined. In addition, quality factor and sensitivity of the device are improved due to the variation of refractive index of layer B, thickness of defect, angle of incidence and the number of unit cells on either side of defect layer. By making analysis of the effect of these parameters on the sensitivity and quality factor, interesting results have been obtained and conclusions drawn. We have also proposed and investigated a symmetric structure with defect made with a single material to improve optical sensing parameters. Further for the sake of comparison, the various gases are used to show improved sensing characteristics for respective gases, which can be used to determine gas. It is inferred that such refractive index optical sensor based on defect mode position is highly sensitive and offers precise optical sensing characteristics and possibly find applications in gas detection.