Halochromism has a plethora of uses in the textile industry, including wound treatments and protective apparel. Reactive dye’s fastness and a wide variety of hues, from bright to dull, make it ideal for coloring cotton and other regenerated cellulose fibers. It is also fundamentally paramount importance to determine the freshness of packaging foods. In this study, a halochromic probe, 4,4′-((1E,1′E,3E,3′E)-hydrazine-1,2-diylidenebis(prop-1-en-1-yl-3-ylidene))bis(N, N-dimethylaniline), HDBD, has been introduced utilizing a simple condensation reaction. Through the protonation and deprotonation process with the addition of acid and base in the non-aqueous medium, HDBD shows visual colorimetric as well as ratiometric UV–visible absorption spectral change. A colorimetric paper strip-based experiment has been demonstrated to detect trace amounts of acid and its reversibility with bases in non-aqueous solvents. Further, a dip-stick experiment was also carried out for the detection of acid-base vapor in a wide range of concentrations. Furthermore, the overlapping indicator method is explored to estimate acid dissociation constants in the non-aqueous medium. Moreover, we have constructed the INHIBIT (INH) and IMPLICATION (IMP) molecular logic gates exploring the reversibility of HDBD due to the cascade introduction of acid-base as chemical encoded inputs. Utilizing a reversible and reproducible detecting method, we have constructed a molecular-scale additional memory device that demonstrates binary logic “Writing-Reading-Erasing-Reading” and “Multi-write” functions. This finding provides a new way for designing acid-base indicators, which could estimate the acid dissociation constants of various acids in the non-aqueous environment which is fundamentally important in the field of acid-catalyzed organic synthesis.