Nanocomposite of polyaniline (PANI) and multi walled carbon nanotube (MWCNT) was synthesised by ex‐situ solution mixing process in the N‐Methyl‐2‐Pyrrolidinone (NMP) solvent medium by varying the concentration of MWCNT in the PANI matrix. PANI‐MWCNT composite films were prepared by the drop casting method. The morphology, structure and chemical composition of PANI and PANI‐MWCNT nanocomposites were characterised by scanning electron microscopy (SEM), transmission electron microscopy (TEM), x‐ray diffraction (XRD), and Fourier transform infrared spectroscopy (FT‐IR) spectra. The experimental findings suggested a favourable synergy between PANI and MWCNTs. PANI‐MWCNT nanocomposite formed as randomly oriented nanofibrous clusters was confirmed, and the bandgap of the composites was found to be gradually decreased with the increase in concentration of MWCNT in the PANI matrix. The calculation of crystallinity index, crystallite size, average d‐spacing, dislocation density, lattice strain, and inter chain separation of the samples were conducted by XRD analysis. When the MWCNT concentration increased from 0.05 % w/v to 0.5 % w/v, a rise in the degree of crystallinity from 3.39 % to 52.46 %, dislocation density from 0.03315×10−3(nm−2)to 0.07133×10−3 (nm−2) and lattice strain from 8.6821×10−3 to 12.9843×10−3, accompanied by a reduction in both crystallite size and inter‐chain separation were observed .The microcrystalline behaviour and crystalline orientation of the PANI‐MWCNT composites were correlated with the bandgap studies. The composite formation improved the thermal stability of PANI. The co‐relation between the crystallinity parameters and fine tuning of optical bandgap and the control over the defect levels were done in this study. This synergy suggests that these composites are suitable candidates for linear and nonlinear optical (NLO) applications.