Antimicrobial polymers have been widely reported to exert strong biocidal effects against bacteria. In contrast with antimicrobial polymers with aliphatic ammonium groups, polymers with anilinium groups have been rarely studied and applied as biocidal materials. In this study, a representative polymer with aniline side functional groups, poly(N,N‐dimethylaminophenylene methacrylamide) (PDMAPMA), was explored as a novel antimicrobial polymer. PDMAPMA was synthesized and its physicochemical properties evaluated. The methyl iodide‐quaternized polymer was tested against the Gram‐positive Staphylococcus aureus, with a minimum inhibitory concentration (MIC) and minimum bactericidal concentration (MBC) of 16–32 and 64–128 μg mL−1, respectively. Against the Gram‐negative Escherichia coli, the MIC and MBC were both 64–128 μg mL−1. To broaden the range of applications, PDMAPMA was coated on substrates via crosslinking to endow the surface with contact‐kill functionality. The effect of charge density of the coatings on the antimicrobial behavior was then investigated, and stronger biocidal performance was observed for films with higher charge density. This study of the biocidal behavior of PDMAPMA both in solution and as coatings is expected to broaden the application of polymers containing aniline side groups and provide more information on the antimicrobial behavior of such materials. © 2019 Wiley Periodicals, Inc. J. Polym. Sci., Part A: Polym. Chem. 2019, 57, 1908–1921