In this study, an amphoteric grafting chitosan-based flocculant (carboxymethyl chitosan-graft-poly(2-methacryloyloxyethyl) trimethyl ammonium chloride, denoted as CMC-g-PDMC) was applied to removal of the anionic and cationic dyes, acid Green 25 (AG25) and Basic Bright Yellow (7GL), from water. Flocculation conditions have been optimized by response surface methodology (RSM) on the basis of central composite design (CCD) using flocculant dosage, initial solution pH and temperature as input variables. The second-order and cubic regression models, which have been both tested by the analysis of variance (ANOVA), were constructed to link the output response (the dye removal factor) with the aforementioned input variables, respectively. The second-order regression model well described the process of AG25 removal, whereas the cubic one is more suitable for that of 7GL. The effects of those variables on the flocculation performance of CMC-g-PDMC for removal of the two dyes containing opposite charges from aqueous solutions have been studied, and the flocculation mechanisms including the interactive effects between various influencing factors have been discussed in detail also.