This study investigates the synthesis and characterization of new diamines with car- bazole and imidazole pendant groups, leading to the development of polyamides and polyimides. The polyamides were synthesized by reacting diamines with carboxylic acids using polyamidation and phosphorylation techniques, while polyimides were prepared by combining diamines and dianhydrides. FT–IR and 1H-NMR analyses were used for comprehensive structural elucidation of diamine, polyamides, and polyimides. The polyamides and polyimides with inherent viscosities ranging from 0.48 to 0.64 dL/g showed notable thermal stability. The T 10% weight loss values were between 287 and 340 °C for polyamides and 321–381 °C for polyimides. The percentage of char residue varied between 33 and 56% at 700 °C. Additionally, the maximum emission wavelengths of polymers ranged from 410 to 436 nm. The pres- ence of bulky carbazole and imidazole pendant groups facilitated the good solubility of the polymers in common organic solvents. The antibacterial properties of syn- thesized polyamides and polyimides against both Gram-negative and Gram-positive bacteria and fungi were investigated.