The development of an optochemical sensor for colorimetric determination of trinitrotoluene (TNT) from aqueous samples is described. The optode film was formed based on the immobilization of trioctylmethylammonium chloride (Aliquat 336) on a triacetylcellulose membrane, which acts as a fixed carrier and anion‐exchanger. When the colorless and transparent optochemical sensor are employed in TNT solution samples, a red‐orange color with maximum absorption wavelength at 530 nm develops in consequence of formation of TNT‐Aliquat 336 ion pair in the sensor membrane. The optical response of this optode is being proportional to concentration of TNT in aqueous solution. Various experimental parameters such as pH, optode composition, response time and reversibility have been studied and optimized. The analytical performance of the optode was evaluated, obtaining a linear response over the range of 1.0 to 16.0 mg/L, a limit of detection of 0.14 mg/L, good reproducibility and selectivity. The sensor was seen to exhibit a fully reversible response. The developed optode in the present work was applied to the determination of TNT in water and soil samples with satisfactory results.