An image forming apparatus, comprising: an image carrying member to carry a toner image on a surface of the image carrying member; a nip forming member, contactable to the surface of the image carrying member carrying the toner image, and configured to form a transfer nip between the nip forming member and the image carrying member; and a transfer bias outputting unit configured to output a transfer bias to set a transfer field at the transfer nip, the transfer bias transferring the toner image carried on the image carrying member to a recording medium passing through the transfer nip, and to output a transfer bias composed of a direct current component and an alternating current component, at least one of the DC component and the AC component being subjected to constant voltage control, when the toner image is transferred from the image carrying member to the recording medium; a voltage detector configured to detect a detection bias voltage at the transfer nip, when constant current control is conducted at a timing other than when the toner image is being transferred from the image carrying member to the recording medium; and wherein the voltage of at least one of the DC component and the AC component is controlled based on the detection bias voltage detected during constant current control; characterized in that: the AC component includes a pulse having a peak Vt and a peak Vr to form an electric field to move toner charged to normal polarity in the transfer nip, wherein at the peak Vt, an electric field to move the toner in a direction from the image carrying member toward the nip forming member is formed in the transfer nip, and wherein at the peak Vr, an electric field to move the toner in a direction from the nip forming member toward the image carrying member is formed in the transfer nip, wherein the Vr and Vt are computed based on the detection bias voltage at the transfer nip, and then the peak-to-peak voltage of the AC component and the voltage of the DC component are computed using the computed Vr and Vt; and wherein the peak-to-peak voltage of the AC component and duty of the AC component are changed based on the detection bias voltage detected at the transfer nip; wherein the greater the absolute value of the voltage of the detected bias voltage at the transfer nip, the greater the peak-to-peak voltage of the AC component, and the smaller the duty of the AC component; wherein by changing the AC voltage, the time-average voltage of AC voltage changes. an image carrying member to carry a toner image on a surface of the image carrying member; a nip forming member, contactable to the surface of the image carrying member carrying the toner image, and configured to form a transfer nip between the nip forming member and the image carrying member; and a transfer bias outputting unit configured to output a transfer bias to set a transfer field at the transfer nip, the transfer bias transferring the toner image carried on the image carrying member to a recording medium passing through the transfer nip, and to output a transfer bias composed of a direct current component and an alternating current component, at least one of the DC component and the AC component being subjected to constant voltage control, when the toner image is transferred from the image carrying member to the recording medium; a voltage detector configured to detect a detection bias voltage at the transfer nip, when constant current control is conducted at a timing other than when the toner image is being transferred from the image carrying member to the recording medium; and wherein the voltage of at least one of the DC component and the AC component is controlled based on the detection bias voltage detected during constant current control; characterized in that: the AC component includes a pulse having a peak Vt and a peak Vr to form an electric field to move toner charged to normal polarity in the transfer nip, wherein at the peak Vt, an electric field to move the toner in a direction from the image carrying member toward the nip forming member is formed in the transfer nip, and wherein at the peak Vr, an electric field to move the toner in a direction from the nip forming member toward the image carrying member is formed in the transfer nip, wherein the Vr and Vt are computed based on the detection bias voltage at the transfer nip, and then the peak-to-peak voltage of the AC component and the voltage of the DC component are computed using the computed Vr and Vt; and the AC component includes a pulse having a peak Vt and a peak Vr to form an electric field to move toner charged to normal polarity in the transfer nip, wherein at the peak Vt, an electric field to move the toner in a direction from the image carrying member toward the nip forming member is formed in the transfer nip, and wherein at the peak Vr, an electric field to move the toner in a direction from the nip forming member toward the image carrying member is formed in the transfer nip, wherein the Vr and Vt are computed based on the detection bias voltage at the transfer nip, and then the peak-to-peak voltage of the AC component and the voltage of the DC component are computed using the computed Vr and Vt; and wherein the peak-to-peak voltage of the AC component and duty of the AC component are changed based on the detection bias voltage detected at the transfer nip; wherein the greater the absolute value of the voltage of the detected bias voltage at the transfer nip, the greater the peak-to-peak voltage of the AC component, and the smaller the duty of the AC component; wherein by changing the AC voltage, the time-average voltage of AC voltage changes.