Coumarin based hydrazide-hydrazone (CHH) derivative was synthesized and evaluated for in silico antiviral activity against SARS-CoV-2 and anti-HIV activity. The experimental techniques (FT-IR, 1H NMR, 13C NMR and UV-vis) and computational calculations (B3LYP functional and 6-31G(d,p)/6-311G(d,p) level of theory) were used for the detailed analysis of the synthesized compound. By following the mechanosynthesis methodology, the excellent yield and reduction in reaction time were observed in the grinding method when compared to conventional method. The rotational barrier between conformer I and II of CHH was found to be 5.102 Kcal/mol in the gas phase. The FT-IR spectrum was carried out to support the hydrogen bonding pattern proposed by reported crystalline structure. The electronic descriptors studies indicate CHH used as useful synthon for new heterocyclic compounds. The first static hyperpolarizability (β0) of the CHH was calculated as 17.47 and 25.93 10–30 esu at B3LYP/6-31G (d,p) and B3LYP/6-311G(d,p) basis set indicates CHH may be used as non-linear optical material. The ADMET, isoelectronic molecular electrostatic potential surfaces (MEPS), NBO and QTAIM studies were also performed. According to molecular docking, the synthesized CHH compound showed strong antiviral efficacy against SARS COV-2 major protein (Mpro) with PDB code 6lu7 and anti-HIV antibody DH501, an unmutated common ancestor with PDB ID 6p3b.