A charging device includes a charging member disposed so as to rotate in
contact with a surface of an image carrier to charge the image carrier
surface, a bias voltage applying unit that applies a bias voltage to the
charging member, the bias voltage having an AC voltage superimposed on a
DC voltage, a DC current detector that detects a DC current flowing
between the image carrier and the charging member, a filter that extracts
only a specific component from the DC current detected by the DC current
detector, and a controller that controls at least one of an AC voltage
and an AC current to be applied to the charging member in accordance with
an amount of variation of the specific component extracted from the DC
current by the filter.