By dint of their excessive toxicity and non-biodegradable characteristics, detection of the nitroanilines that have detrimental impacts on human health and the aquatic environment is a crucial issue. For this aim, the potentiality of the silicon carbide (C12Si12) nanocage toward sensing nitroaniline compounds, including ortho-, meta- and para-nitroaniline (ONA, MNA and PNA, respectively), was accomplished through DFT computations. The electrostatic potential findings corroborated the remarkable ability of the C12Si12 nanocage to sense the ONA, MNA, and PNA molecules via the two substantial nucleophilic sites (i.e., N and O atoms) of the aforementioned molecules in the most favorable configurations. In the light of the energetic affirmations, negative interaction energies were recorded for the investigated complexes with values up to − 37.13 kcal/mol. According to the symmetry-adapted perturbation theory findings, the electrostatic force was remarked as the prevailing contribution within the adsorption process. A closer look at the outcomes of the noncovalent interaction index and the quantum theory of atoms in molecules pointed out the partially covalent nature of the interactions within the studied complexes. The apparent alterations in the molecular orbital distributions and global reactivity descriptors of the studied C12Si12 nanocage after the adsorption of the ONA, MNA, and PNA molecules proclaimed the occurrence of the scouted adsorption process. The obtained thermodynamic parameters declared the spontaneous exothermic characteristics of the interactions within the inspected complexes. The obtained findings divulged that the C12Si12 nanocage could be regarded as a promising candidate for sensing the ONA, MNA, and PNA toxic molecules, which in turn will have a pivotal role in preserving the environment.