KOH/DMSO-promoted C-N bond formation via nucleophilic aromatic substitution (SNAr) between chloroarenes or fluoroarenes with indoles and carbazole under transition metal-free conditions affording the corresponding N-arylated indoles and carbazoles has been developed.