Gas sensors are of paramount concern for medical, industrial, environmental, and domestic applications. There are two substantial frameworks to monitor the gases either by physical or chemical methods. Recently, optical gas sensing method has been employed for detection of gases because it offers fast response, high selectivity and minimal drift. Herein, highly transparent and single crystalline indium oxide film is prepared by using hexamethylene triperoxide diamine for the first time. The prepared film was characterized through X-ray diffraction, scanning and transmission electron microscopies. It was found that the indium oxide film has a body center cubic structure and has single crystalline phase. The formed nanoparticles were pyramid like shape with dimensions 26nm×16nm×18nm. The film has high transparency (95%) and strong luminescence emission intensity in the UV region. The prepared indium oxide film showed fast, accurate and highly stable gas detection. The optical band gap of the prepared film strongly depends on the type of tested gas. The oxidizing gases caused a blue shift of the luminescence peak and the reducing gases caused a red shift and each gas showed an emission luminescence peak at a certain wavelength. Among all tested gases, the indium oxide film with pyramid like shape was highly sensitive to carbon monoxide along the concentration range from 0 to 100ppm.