The effect of resonant magnetic perturbations (RMPs) on particle transport has been studied in J-TEXT tokamak. It is found that for the discharges with an existing saturated 2/1 resistive tearing mode, applied RMPs of moderate amplitude lead to a decrease in electron density with a relative amplitude 3% < |ne/ne0| < 10% in plasma core, and the mode stabilization and electron temperature increase are observed simultaneously in this case. Sufficiently large amplitude of RMPs, however, lead to locked modes and much larger decrease in the electron density as well as in the electron temperature, with |ne/ne0| ~ 20%. For the discharges without 2/1 tearing modes, applied RMPs cause a relative density decrease |ne/ne0| ~ 10% (30%) before (after) field penetration. Using the two-fluid equations and experimental parameters as input, the numerical results approximately agree with experimental observations.