The 1,l/-bis(2-phenylethan-1-ol)ferrocene, 1-butyl-3-methylimidazolium hexafluoro phosphate (BMPF6) and NiO-SWCNTs were used to modify carbon paste electrode (BPOFc/BMPF6/NiO-SWCNTs/CPE), which could act as an electro-catalytic tool for the analysis of N-acetylcysteine in this work. The BPOFc/BMPF6/NiO-SWCNTs/CPE with high electrical conductivity showed two completely separate signals with oxidation potentials of 432 and 970 mV for the first time that is sufficient for the determination of N-acetylcysteine in the presence of theophylline. The BPOFc/BMPF6/NiO-SWCNTs/CPE showed linear dynamic ranges of 0.02–300.0 μM and 1.0–350.0 μM with the detection limit of ~ 8.0 nM and 0.6 μM for the measurement of N-acetylcysteine and theophylline, respectively. In the second part, understanding the nature of interaction, quantum conductance modulation, electronic properties, charge density, and adsorption behavior of N-acetylcysteine on NiO–SWCNTs surface from first-principle studies through the use of theoretical investigation is vital for designing high-performance sensor materials. The N-acetylcysteine molecule was chemisorbed on the NiO–SWCNTs surface by suitable adsorption energies (− 1.102 to − 5.042 eV) and reasonable charge transfer between N-acetylcysteine and NiO–SWCNTs.