An image forming apparatus comprising: a transfer unit for transferring a toner image carried on an image carrier to a recording medium; a power supply unit for supplying power conforming to the control target value to the transfer unit; a voltage detection unit for detecting a voltage value for the transfer unit; a current detection unit for detecting a value of a current flowing to the transfer unit; a determination unit that acquires a detection value of the voltage detection unit and a detection value of the current detection unit and that determines, as the control target value for the power supply unit, an optimum value of a control target (I b) derived from a characteristic line showing a relationship between an electric characteristic value based on both detection values (S2,S4) or a detection value of the voltage detection unit and an optimum value of the control target (I b), wherein at least one coefficient of an arithmetic expression specifying the characteristic line being stored in a memory as a function showing the relationship between a width of the recording medium and the coefficient and the characteristic line is a line showing a relationship of a change in absolute value of an optimum value of the control target (I b) shifting from an increasing tendency to a decreasing tendency with an increase in an absolute value of the electrical characteristic value or an absolute value of the detection value of the voltage detection unit, characterized by an ascertainment unit for ascertaining the type of the recording medium, wherein the determination unit selects, according to the type of the recording medium ascertained by the ascertainment unit, the characteristic line as a monotonous line along which a change in an absolute value of an optimum value of the control target does not reversely increase or decrease with an increase in the electrical characteristic value or an absolute value of a detection value of the voltage detection unit, to thus determine the optimum value (I b).. a transfer unit for transferring a toner image carried on an image carrier to a recording medium; a power supply unit for supplying power conforming to the control target value to the transfer unit; a voltage detection unit for detecting a voltage value for the transfer unit; a current detection unit for detecting a value of a current flowing to the transfer unit; a determination unit that acquires a detection value of the voltage detection unit and a detection value of the current detection unit and that determines, as the control target value for the power supply unit, an optimum value of a control target (I b) derived from a characteristic line showing a relationship between an electric characteristic value based on both detection values (S2,S4) or a detection value of the voltage detection unit and an optimum value of the control target (I b), wherein at least one coefficient of an arithmetic expression specifying the characteristic line being stored in a memory as a function showing the relationship between a width of the recording medium and the coefficient and the characteristic line is a line showing a relationship of a change in absolute value of an optimum value of the control target (I b) shifting from an increasing tendency to a decreasing tendency with an increase in an absolute value of the electrical characteristic value or an absolute value of the detection value of the voltage detection unit, characterized by an ascertainment unit for ascertaining the type of the recording medium, wherein the determination unit selects, according to the type of the recording medium ascertained by the ascertainment unit, the characteristic line as a monotonous line along which a change in an absolute value of an optimum value of the control target does not reversely increase or decrease with an increase in the electrical characteristic value or an absolute value of a detection value of the voltage detection unit, to thus determine the optimum value (I b)..