The antibacterial activity and mechanism of two kinds of chitosan were investigated against twelve Xanthomonas strains recovered from Euphorbia pulcherrima. Results indicated that both chitosans markedly inhibited bacterial growth based on OD loss. Furthermore, the release of DNA and RNA from three selected strains was increased by both chitosans. However, the release of intracellular proteins was inhibited by both chitosans at different concentration and incubation times, except chitosan A at 0.1 mg/mL for 0.5 h incubation and 0.2 mg/mL for 2.0 h incubation increased the release of proteins, indicating the complexity of the interaction and cell membranes, which was affected by incubation time, bacterial species, chitosan type and concentration. Transmission electron microscopic observations revealed that chitosan caused changes in protoplast concentration and surface morphology. In some cells, the membranes and walls were badly distorted and disrupted, while other cells were enveloped by a thick and compact ribbon-like layer. The contrary influence on cell morphology may explain the differential effect in the release of material. In addition, scanning electron microscope and biofilm formation test revealed that both chitosans removed biofilm biomass. Overall, this study showed that membrane and biofilm play an important role in the antibacterial mechanism of chitosan.