A practical technique was applied to fabricate CuO nanostructures for use as the electrocatalyst. The green synthesis of cupric oxide nanoparticles (CuO NPs) via co-precipitation is described in this paper using an aqueous extract of Origanum majorana as both reductant and stabilizer, accompanied by characterization via XRD, SEM, and FTIR. The XRD pattern revealed no impurities, whereas SEM revealed low agglomerated spherical particles. CuO nanoparticles and multi wall carbon nanotubes (MWCNTs) have been used to create a modified carbon paste electrode. Voltammetric methods were used to analyze Tramadol using CuONPs/MWCNT as a working electrode. The produced nanocomposite showed high selectivity for Tramadol analysis with peak potentials of ~ 230 mV and ~ 700 mV and Excellent linear calibration curves for Tramadol ranging from 0.08 to 500.0 µM with a correlation coefficient of 0.9997 and detection limits of 0.025. Also, the CuO NPs/MWCNT/CPE sensor shows an an appreciable sensitivity of 0.0773 μA/μM to tramadol. For the first time the B3LYP/LanL2DZ, quantum method was used to compute DFT to determine nanocomposites' connected energy and bandgap energy. Eventually, CuO NPs/CNT was shown to be effective in detecting Tramadol in actual samples, with a recovery rate ranging from 96 to 104.3%.